6

是否可以将软件包安装到任意文件夹?例如,我试图将一个包安装到本地文件夹,但它抛出错误,同样的错误出现在任何其他包中

/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'

这个问题也表明它应该可以工作,那么这里有什么问题?

4

1 回答 1

10

--prefix=必须是绝对路径。正在做:

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

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

于 2012-10-09T21:03:57.830 回答