pip install --target fails
See original GitHub issuedocker build -t pip_error .
docker run --name pip_error -it pip_error
pip install --target /tmp/target_directory -vvv "psutil"
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 348, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpO5kwWK/lib/python/'
Full Log: https://gist.github.com/chrismeyersfsu/6967e1f41db9660cdc1b
[root@59cecad2bf5a /]# pip --version
pip 7.1.0 from /usr/lib/python2.7/site-packages (python 2.7)
Also ran pip install pip --upgrade (to v 7.1.2) and still had the same error.
Dockerfile
FROM centos:7
RUN yum install -y epel-release http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
RUN yum install -y git rpmlink rpmdevtools gcc make gcc-c++ nodejs npm python-devel libxml2-devel libxslt-devel zeromq-devel mongodb-org python-pymongo-gridfs pymongo=2.8 nodejs-grunt-cli python-pip postgresql94-devel libffi-devel openldap-devel
#ENV PATH=$PATH:/usr/pgsql-9.4/bin/
CMD /bin/bash
Also tried
DISTUTILS_DEBUG=1 pip install -t /tmp/me --install-option="--install-purelib=\$base/lib64/python" billiard Fails and doesn’t seem to effect the install_purelib disutils variable.
https://gist.github.com/chrismeyersfsu/709a80df91176bc9f7bc
Solution:
Creating a setup.cfg with below contents successfully effected the disutils install_purelib variable.
DISTUTILS_DEBUG=1 pip install -t /tmp/install_here -vvvv psutil
Log: https://gist.github.com/chrismeyersfsu/036b494a2a37d636839b
[install]
install-purelib=$base/lib64/python
Reflections:
My question now is, who is at ‘fault’ ? Should pip default to using the purelib directory? Or should a directive exist that complements --target to choose the variable from which to look for the artifacts (i.e. --target-use <purelib, lib>)
Further, why did --install-option="--install-purelib=\$base/lib64/python" have no effect?
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (3 by maintainers)

Top Related StackOverflow Question
@wm75 Aha, yes! Upgrading from pip 8.1.1 to 8.1.2 has fixed this issue.
Thanks.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.