我为Python 3创建了一个虚拟环境
$ mkvirtualenv -p /opt/local/bin/python3 testenv
在该环境有效的情况下,我已经安装了uno
(testenv) $ pip3 install uno
我确定我正在运行Python 3
(testenv) $ python
Python 3.6.1 (default, Jul 7 2017, 20:04:34)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
但是当我尝试导入uno
...
>>> import uno
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/me/Workspace/venvs/testenv/lib/python3.6/site-packages/uno/__init__.py", line 4, in <module>
from base import Element, Css, Payload, UnoBaseFeature, UnoBaseField
ModuleNotFoundError: No module named 'base'
然而,base.py
存在于正确的位置
(testenv) $ ls ~/Workspace/venvs/testenv/lib/python3.6/site-packages/uno
__init__.py css_constants.py input_elements.py
__pycache__ decorators.py quickadder.py
base.py field.py search.py
constants.py form.py
core.py helpers.py
为什么Python 3找不到指定的文件,我该如何解决?