我在 Eclipse 上的 PyDev 设置中尝试这样做:
from sqlalchemy.engine import create_engine
这给了我以下错误:
Traceback (most recent call last):
File "/Users/<username>/Documents/workspace/You/src/Ormtest.py", line 7, in <module>
import sqlalchemy
File "build/bdist.macosx-10.8-intel/egg/sqlalchemy/__init__.py", line 7, in <module>
# For license information, see LICENSE.TXT
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/inspect.py", line 39, in <module>
import tokenize
File "/Library/Python/2.7/site-packages/nltk/tokenize/__init__.py", line 50, in <module>
from nltk.data import load
File "/Library/Python/2.7/site-packages/nltk/__init__.py", line 106, in <module>
from decorators import decorator, memoize
File "/Library/Python/2.7/site-packages/nltk/decorators.py", line 176, in <module>
@decorator
File "/Library/Python/2.7/site-packages/nltk/decorators.py", line 154, in decorator
if inspect.isclass(caller):
AttributeError: 'module' object has no attribute 'isclass'
这在交互式控制台上运行良好。Eclipse 也不会在导入时给我任何错误/警告。知道我在这里想念什么吗?