Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install to a local folder

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?

like image 783
Anurag Uniyal Avatar asked Oct 09 '12 20:10

Anurag Uniyal


1 Answers

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

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

for example, should work without any errors.

like image 151
Pedro Romano Avatar answered Oct 04 '22 22:10

Pedro Romano