Skip to content

lib path is hardcoded in backwardcompat/__init__.py:home_lib() #899

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

Closed
haxwithaxe opened this issue Apr 17, 2013 · 7 comments
Closed

lib path is hardcoded in backwardcompat/__init__.py:home_lib() #899

haxwithaxe opened this issue Apr 17, 2013 · 7 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@haxwithaxe
Copy link

library path in home_lib() in backwardcompat/init.py is hardcoded to 'lib' this breaks when the system default is lib64.
pip install --target /home/user/twitter-pip twitter
displays the problem.

Downloading/unpacking twitter
  Running setup.py egg_info for package twitter

Installing collected packages: twitter
  Running setup.py install for twitter

    Installing twitter-log script to /tmp/tmpXgpY70/bin
    Installing twitter script to /tmp/tmpXgpY70/bin
    Installing twitterbot script to /tmp/tmpXgpY70/bin
    Installing twitter-follow script to /tmp/tmpXgpY70/bin
    Installing twitter-stream-example script to /tmp/tmpXgpY70/bin
    Installing twitter-archiver script to /tmp/tmpXgpY70/bin
Successfully installed twitter
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/usr/lib64/python2.7/site-packages/pip/commands/install.py", line 265, in run
    for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpException:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/usr/lib64/python2.7/site-packages/pip/commands/install.py", line 265, in run
    for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpXgpY70/lib/python'

the directroy created during install is /tmp/tmpXgpY70/lib64/

i don't have a good fix but i did check for the 'ARCH' environmental variable and set the lib directory accordingly in the home_lib() function.

@qwcode
Copy link
Contributor

qwcode commented Apr 17, 2013

in all of the cpython's, the home scheme literally does just use the lib/python path.
http://docs.python.org/3.3/install/#alternate-installation-the-home-scheme

this is arch linux?

we do have a pip.locations.distutils_scheme method we could use for this.
maybe you can try that on arch and confirm it works (set home=True)

@haxwithaxe
Copy link
Author

slackware64 current
where am i supposed to use "pip.locations.distutils_scheme"? i just picked a random module and directory to try the --target argument.

@qwcode
Copy link
Contributor

qwcode commented Apr 18, 2013

let me work up a pull tomorrow, and you can try it.

@qwcode
Copy link
Contributor

qwcode commented Apr 20, 2013

merged the pull request for this.

@qwcode qwcode closed this as completed Apr 20, 2013
@movermeyer
Copy link

I can still reproduce this using:

pip install --target . lxml

on

  • CentOS 6.7
  • python.x86_64 2.6.6-64.el6
  • pip 7.1.2

Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/usr/lib/python2.6/site-packages/pip/commands/install.py", line 351, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpTCtSpy/lib/python'

But the lib64 variant is present:

ls -R /tmp/tmpTCtSpy/

/tmp/tmpTCtSpy/:
lib64

/tmp/tmpTCtSpy/lib64:
python

/tmp/tmpTCtSpy/lib64/python:
lxml lxml-3.4.4-py2.6.egg-info

...

@haxwithaxe
Copy link
Author

is the lib path in home_lib() in backwardcompat/__init__.py still hardcoded to 'lib'? this ticket was specific to a code change not a specific runtime error.

@movermeyer
Copy link

Sorry, I wasn't sure where to post this. At first I thought it might be a regression (and it still may be),
but I think that we'll continue the discussion on this Github issue.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants