使用本地 Python 构建安装 Python 模块
我在 ~/Python2.7/ 本地安装了 python 2.7,并且需要 psycopg2 模块。但是当我尝试使用 easy_install 安装它或手动编译它时,我
error: invalid Python installation: unable to open /usr/local/lib/python2.7/config/Makefile (No such file or directory)
尝试将 ~/Python2.7/Lib/sysconfig.py 中的一行从 更改为 ,但
return os.path.join(get_path('stdlib'), "config", "Makefile")
没有
return '/home/foo/Python2.7/Makefile'
效果。我该怎么做才能解决这个问题?
I have python 2.7 installed locally in ~/Python2.7/ and I need the psycopg2 module. But when I try to install it with easy_install or compile it manually, I get
error: invalid Python installation: unable to open /usr/local/lib/python2.7/config/Makefile (No such file or directory)
I tried to change a line in ~/Python2.7/Lib/sysconfig.py from
return os.path.join(get_path('stdlib'), "config", "Makefile")
to
return '/home/foo/Python2.7/Makefile'
with no effect. What do I do to walk around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查命令行选项: http://packages.python.org/distribute /easy_install.html#command-line-options 并尝试摆弄您的 --install-dir 。本地安装还需要位于 PYTHONPATH 环境变量中。如果您尝试在本地安装所有内容,请尝试使用 pip 而不是 easy_install,并设置虚拟环境(来自 virtualenv)。
Check the command line options: http://packages.python.org/distribute/easy_install.html#command-line-options and try fiddling around with your --install-dir . The local install would also need to be in the PYTHONPATH environment variable. If you are trying to install everything locally, try using pip, instead of easy_install, and setup a virtual environment (from virtualenv).