无法在mac上启动python

时间:2015-12-08 00:09:27

标签: python macos python-2.7

我一直在笔记本电脑上使用python,并注意到今天早上python不再执行任何脚本了。通过很少的调试我意识到python甚至没有在我的工作区上启动它的提示。我在下面使用python 2.7:

Pranav-Mac:[~]$ python
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 548, in <module>
    main()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 527, in main
    known_paths = removeduppaths()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 110, in removeduppaths
    dir, dircase = makepath(dir)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 80, in makepath
    dir = os.path.join(*paths)
AttributeError: 'module' object has no attribute 'path'
Pranav-Mac:[~]$ echo $PYTHONPATH
/Users/pranav/mylib
Pranav-Mac:[~]$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/mysql/bin
Pranav-Mac:[~]

所以我尝试重新安装python 2.7.11并没有解决问题。 有什么可能出错的线索吗?

1 个答案:

答案 0 :(得分:0)

从我的mac中删除了所有旧的* .pyc文件以解决此问题。