New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install --target ignores platlib directories #3682

Closed
chandu-atina opened this Issue May 13, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@chandu-atina
Contributor

chandu-atina commented May 13, 2016

  • Pip version: 8.1.2
  • Python version: 2.7.5
  • Operating System: centos7 64 bit

Description:

pip install with --target option has an issue with lib64 packages(platlib).

  1. When I tried to install mysql-python using the following command, I ran into an error saying no such file or directory.

pip install --target=/var/tmp/ mysql-python

Issue:
The issue is that the package is installed in platlib directory " /tmp/{random_string}/lib64/python " but pip is trying to move files only from purelib directory to target directory but not platlib directory. So it checks for directories under "/tmp/{random_string}/lib/python" and throws exception saying no such file or directory.

  1. When I tried to install paramiko==1.16.0 using the following command, I found pycrypto package is missing which is a dependent package for paramiko.

`pip install --target=/var/tmp/paramiko paramiko==1.16.0``

Issue:
There are three packages (paramiko, ecdsa, pycrypto) that are installed in /tmp/{random_string} directory. paramiko and ecdsa are installed in purelib "/tmp/{random_string}/lib/python" and pycrypto is installed in platlib "/tmp/{random_string}/lib64/python" which is expected based on system architecture. But pip moves files under purelib to target directory but not files under platlib, as a result pycrypto packages in missing. Moreover the success message says "Successfully installed ecdsa-0.13 paramiko-1.16.0 pycrypto-2.6.1"

What I've run:

pip install --target=/var/tmp/ mysql-python

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 368, in run
    for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpbtxE72/lib/python'
pip install --target=/var/tmp/paramiko paramiko==1.16.0
Collecting paramiko==1.16.0
  Using cached paramiko-1.16.0-py2.py3-none-any.whl
Collecting ecdsa>=0.11 (from paramiko==1.16.0)
  Using cached ecdsa-0.13-py2.py3-none-any.whl
Collecting pycrypto!=2.4,>=2.1 (from paramiko==1.16.0)
  Using cached pycrypto-2.6.1.tar.gz
Installing collected packages: ecdsa, pycrypto, paramiko
  Running setup.py install for pycrypto ... done
Successfully installed ecdsa-0.13 paramiko-1.16.0 pycrypto-2.6.1

Note:

I'm planning to fix this and raise a pull request so that pip considers both purelib as well as platlib (if both are different and exists)

@scottvrosenthal

This comment has been minimized.

Show comment
Hide comment
@scottvrosenthal

scottvrosenthal Jul 18, 2016

This should of been included in a bugfix release IMHO... not a new release. At any rate, thanks for the fix! Needed this when pip installing PyYAML etc on amazon linux/centos.

scottvrosenthal commented Jul 18, 2016

This should of been included in a bugfix release IMHO... not a new release. At any rate, thanks for the fix! Needed this when pip installing PyYAML etc on amazon linux/centos.

@dholth

This comment has been minimized.

Show comment
Hide comment
@dholth

dholth Jul 19, 2016

Member

Lament that the distinction between purelib and platlib is a thing. In 2012 I could not find a single system that made the distinction, now it is common.

Member

dholth commented Jul 19, 2016

Lament that the distinction between purelib and platlib is a thing. In 2012 I could not find a single system that made the distinction, now it is common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment