導入我創建的模塊時遇到問題。該模塊與我需要導入它的模塊位於相同的文件夾中。我的工作稱爲directo_etapas.py
模塊多數民衆贊成,並從那裏我需要進口solvers.py
,所以我去:從同一文件夾導入模塊時遇到問題
import math
import solvers
在導入數學模塊我沒有得到任何錯誤,但我得到一個錯誤與import solvers
。
我得到這個錯誤:
"C:\Users\...\Codigos\directo_etapas.py"
Traceback (most recent call last):
File "C:\Users\...\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\site-packages\IPython\core\ultratb.py", line 776, in structured_traceback
records = _fixed_getinnerframes(etb, context, tb_offset)
File "C:\Users\...\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\site-packages\IPython\core\ultratb.py", line 230, in wrapped
return f(*args, **kwargs)
File "C:\Users\...\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.5.5.3123.win-x86_64\lib\site-packages\IPython\core\ultratb.py", line 267, in _fixed_getinnerframes
if rname == '<ipython console>' or rname.endswith('<string>'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 80: ordinal not in range(128)
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
**Unfortunately, your original traceback can not be constructed.**
請注意,我使用Enthough雨棚。
當你註釋掉'import solvers'時,這個錯誤不會發生嗎? – sobek
錯誤似乎指向在'.py'文件中有非ascii字符(ñ,á,é...)?也許?看看這裏:https://www.python.org/dev/peps/pep-0263/ – BorrajaX
謝謝!有效。路徑名包含一個「á」,所以我重命名它,它的工作。 –