0

在 Mac 上:

Traceback (most recent call last):
  File "project1/scripts/initializedb.py", line 3, in <module>
    import transaction
  File "/Users/denmojo/code/project1/env/lib/python3.5/site-packages/transaction/__init__.py", line 19, in <module>
    from transaction._transaction import Transaction
  File "/Users/denmojocode/project1/env/lib/python3.5/site-packages/transaction/_transaction.py", line 20, in <module>
    from zope.interface import implementer
ImportError: No module named 'zope.interface'

无法弄清楚它为什么存在,但没有导入模块。

Using /Users/denmojo/code/project1/env/lib/python3.5/site-packages/zope.interface-4.3.2-py3.5-macosx-10.6-intel.egg
4

1 回答 1

4

试过:

pip uninstall transaction
pip uninstall zope.interface
pip install transaction
pip install zope.interface

解决了这个问题。我想我以前的 virtualenv 设置或无序 pip 安装导致出现问题zope.interface-4.3.2-py3.5-macosx-10.6-intel.egg

于 2016-11-14T07:34:00.587 回答