热线电话:13121318867

登录
2019-02-14 阅读量: 573
AttributeError对象属性错误

报错:

>>> import sys
>>> sys.Path
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Path'

原因:

sys模块没有Path属性。

解决方案:

python对大小写敏感,Path和path代表不同的变量。将Path改为path即可。

>>> sys.path
['',  '/usr/lib/python2.6/site-packages']
0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据