DIYer22 / boxx

Tool-box for efficient build and debug in Python. Especially for Scientific Computing and Computer Vision.
492 stars 39 forks source link

import error #1

Closed zhenming33 closed 6 years ago

zhenming33 commented 6 years ago

你好,我是python3.5的环境,pip install后 import boxx会报如下的错误

import boxx Traceback (most recent call last):

File "", line 1, in import boxx

File "C:\Anaconda3\lib\site-packages\boxx__init__.py", line 21, in from . import ylcompat

File "C:\Anaconda3\lib\site-packages\boxx\ylcompat.py", line 179, in ModuleNotFoundError = ModuleNotFoundError if not py2 else ImportError

NameError: name 'ModuleNotFoundError' is not defined

想问一下有什么解决方法呢?

DIYer22 commented 6 years ago

ModuleNotFoundError 是 Python 3 的内置类型,所以 我需要进一步测试一下,请在 shell 里面运行一下下面这句话,把结果上传一下:

 python -c "import sys;print(sys.platform,sys.version_info);print(ModuleNotFoundError);"
freealong commented 6 years ago

ModuleNotFoundError是Python 3.6才加进来的

DIYer22 commented 6 years ago

@freealong 感谢你指出了错误 Bug fixed by:

try:
    ModuleNotFoundError = ModuleNotFoundError
except NameError:
    ModuleNotFoundError = ImportError

c9c6b80e9a6d45c0b290257f28d9b5507da28c64