将 pythonsetup 工具安装到特定的 python 目录
我必须在网格上工作,我需要安装一些 python 包。我试图安装 pythonsetup 工具,尽管当我运行 python setup.py install 时网格已安装 python,但它拒绝了我的权限:'/usr/local/lib/python2.7/site-packages/test-easy-install- 22642.写测试'。
因此,我在我的主目录中安装了 python2.7,该目录位于 /userpath/Desktop/Python-2.7 中。 现在有人可以告诉我如何执行以下操作。
将 python 路径更改为我的 Desktop/Python-2.7,即当我运行 python 时,它不能从 /usr/local/bin/python 运行,而是必须从安装在我的 home/Desktop/Python-2.7 目录中的 python 运行。
如何将安装工具安装到我的 python 主目录?
I have to work on grid for which I need to install some python packages. I was trying to install pythonsetup tools, though the grid has python installed when i run python setup.py install it gives my Permission denied: '/usr/local/lib/python2.7/site-packages/test-easy-install-22642.write-test'.
Hence I went and installed python2.7 in my home directory which is in /userpath/Desktop/Python-2.7.
Now can someone tell me how to do the following.
Change the python path to my Desktop/Python-2.7 ie when I run python it must not run from /usr/local/bin/python instead it must run from the python installed in my home/Desktop/Python-2.7 directory.
How to install setup tools to my home python directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要进行本地 Python 部署(使用站点包),您可以使用名为 virtualenv 的工具创建隔离的 Python 环境:
http: //pypi.python.org/pypi/virtualenv
它回答了你的两个问题
覆盖默认的Python解释器(激活后)
可以有站点-包在任何文件夹(不需要 root 访问权限)
To have local Python deployments (with site-packages) you can create isolated Python environments with a tool called virtualenv:
http://pypi.python.org/pypi/virtualenv
It answers your both questions
Overrides default Python interpreter (after activation)
Can have site-packages in any folder (no root access needed)