Can't load Python modules installed via pip from site-packages directory
我正在尝试安装和使用Evernote模块(https://github.com/evernote/evernote-sdk-python)。 我跑了
我可以确认evernote模块存在于
1 2 3 | Traceback (most recent call last): File"<string>", line 1, in <module> ImportError: No module named evernote |
这是我的
1 2 3 4 5 6 7 | [[ -s"$HOME/.rvm/scripts/rvm" ]] && source"$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* # Setting PATH for Python 3.3 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}" export PATH export PATH=$PATH:/usr/local/bin/ |
与使用
编辑:我是一个超级新手,并没有编辑该
编辑:
".join(sys.path)'
1 2 3 4 5 6 7 8 9 10 11 12 | /Library/Python/2.7/site-packages/setuptools-1.3.2-py2.7.egg /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC /Library/Python/2.7/site-packages |
编辑:我似乎通过将
为了确保使用与特定python相关联的
我想到了!我添加了这一行:
到我的
我遇到了类似的问题,它与/usr/local/lib/python2.7/site-packages相关,对组和其他组件没有读写权限,并且它们归root所有。这意味着只有root用户才能访问它们。
试试这个:
1 | $ sudo chmod -R go+rX /usr/local/lib/python2.7/site-packages |
这些都没有帮助我解决类似的问题。相反,我必须修复新安装的文件权限才能导入。这通常是一个显而易见的事情,但在安装模块/软件包时使用
只需输入终端:
1 | sudo pip install pillow |
并输入