点安装到本地文件夹 [英] pip install to a local folder

查看:72
本文介绍了点安装到本地文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将软件包安装到任意文件夹?例如我尝试将程序包安装到本地文件夹,但会引发错误,其他任何程序包也会出现相同的错误

Is it possible to install packages to any arbitrary folder? e.g. I tried to install a package to a local folder but it throws error, same error comes up with any other package

/tmp$  pip install --install-option="--prefix=mypython" IPy
Downloading/unpacking IPy
  Downloading IPy-0.75.tar.gz
  Running setup.py egg_info for package IPy

Installing collected packages: IPy
  Running setup.py install for IPy

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
    requirement_set.install(install_options, global_options)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg/pip/req.py", line 1133, in install
    requirement.install(install_options, global_options)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg/pip/req.py", line 604, in install
    f = open(os.path.join(egg_info_dir, 'installed-files.txt'), 'w')
IOError: [Errno 2] No such file or directory: 'mypython/lib/python2.7/site-packages/IPy-0.75-py2.7.egg-info/installed-files.txt'

这个问题表明它应该可以正常工作,那么这里出了什么问题?

Also this question indicate it should be working, so what is wrong here?

推荐答案

--prefix=必须是绝对路径.正在执行:

--prefix= needs to be an absolute path. Doing:

$ pip install --install-option="--prefix=/tmp/mypython" IPy

例如,应该可以正常工作.

for example, should work without any errors.

这篇关于点安装到本地文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆