question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install --target fails

See original GitHub issue
docker 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:closed
  • Created 8 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewmichaelsmithcommented, Aug 8, 2016

@wm75 Aha, yes! Upgrading from pip 8.1.1 to 8.1.2 has fixed this issue.

Thanks.

0reactions
lock[bot]commented, Jun 2, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PIP Install: Cannot combine --user and --target - Stack Overflow
We encountered the same issue when running pip install --target . ... Then I got: ERROR: cannot combine --user and --target.
Read more >
pip install - pip documentation v22.3.1
A failed install is less likely to leave a broken environment. Although pip would like ... Install to the Python user install directory...
Read more >
Package installation issues | PyCharm Documentation
One of the possible failure cases occurs when the target package is not available in the repositories supported by the Conda package manager....
Read more >
Local docker install fails due to lack of python on mac
It fails and gives the error #9 35.38 Installation failed, ... --upgrade --target=/service/node_modules/mediasoup/worker/out/pip meson ninja
Read more >
Add a new and optional pip_index setting when installing a ...
When this is the case, the current setup fails with error <tap/target> could not be installed: failed to upgrade pip to the latest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found