-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix installation using --target #3730
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We encountered a problem on CentOS 7 machines when using the `--target` option to install packages that are equipped with c-extensions. Observe: ``` me@box ~ $ uname -a Linux box.d.rz.is 3.10.0-327.4.4.el7.x86_64 #1 SMP Tue Jan 5 16:07:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux me@box ~ $ python --version Python 2.7.5 me@box ~ $ virtualenv --version 1.10.1 me@box ~ $ virtualenv venv New python executable in venv/bin/python Installing Setuptools.......................................................................................................................................................done. Installing Pip............................................................................................................................................................................................................................................................................done. me@box ~ $ source venv/bin/activate (venv)me@box ~ $ mkdir target (venv)me@box ~ $ ls target venv (venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev -U pip Collecting pip Downloading https://my_proxy:5000/root/pypi/+f/205/6f553d5b593d3/pip-8.0.2-py2.py3-none-any.whl (1.2MB) 100% |████████████████████████████████| 1.2MB 14.3MB/s Installing collected packages: pip Found existing installation: pip 1.4.1 Uninstalling pip-1.4.1: Successfully uninstalled pip-1.4.1 Successfully installed pip-8.0.2 (venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target pyyaml Collecting pyyaml Downloading https://my_proxy:5000/root/pypi/+f/89c/bc92cda979042/PyYAML-3.11.zip (371kB) 100% |████████████████████████████████| 372kB 18.6MB/s Installing collected packages: pyyaml Running setup.py install for pyyaml ... done Successfully installed pyyaml Exception: Traceback (most recent call last): File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run for item in os.listdir(lib_dir): OSError: [Errno 2] No such file or directory: '/tmp/tmpz2LoDs/lib/python' (venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target simplejson Collecting simplejson Downloading https://my_proxy:5000/root/pypi/+f/b84/41f1053edd9dc/simplejson-3.8.1.tar.gz (76kB) 100% |████████████████████████████████| 77kB 19.0MB/s Installing collected packages: simplejson Running setup.py install for simplejson ... done Successfully installed simplejson Exception: Traceback (most recent call last): File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run for item in os.listdir(lib_dir): OSError: [Errno 2] No such file or directory: '/tmp/tmpEFNOZq/lib/python' (venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target markupsafe Collecting markupsafe Downloading https://my_proxy:5000/root/pypi/+f/f5a/b3deee4c37cd6/MarkupSafe-0.23.tar.gz Installing collected packages: markupsafe Running setup.py install for markupsafe ... done Successfully installed markupsafe Exception: Traceback (most recent call last): File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run for item in os.listdir(lib_dir): OSError: [Errno 2] No such file or directory: '/tmp/tmp4UuvDJ/lib/python' (venv)me@box ~ $ ls /tmp/tmp4UuvDJ/ lib64 ``` As you can see using `--target` first installs into a temporary directory and then installes into the desired `target`. Well, at least it tries to: for any packages that have c-extensions (in this case pyyaml, simplejson and markupsafe) it incorrectly looks for a `lib` directory whereas it should be looking for a `lib64` directory. This patch fixes that for us by looking in a fallback location. We can confirm that this fixes the issue for us. Please advise.
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
It seems to me that this can be closed... #3694 does fix this; correct? |
Yes, I suppose so. |
lock
bot
added
the
auto-locked
Outdated issues that have been locked by automation
label
Jun 2, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We encountered a problem on CentOS 7 machines when using the --target option
to install packages that are equipped with c-extensions.
Observe:
me@box ~ $ uname -a
Linux box.d.rz.is 3.10.0-327.4.4.el7.x86_64 #1 SMP Tue Jan 5 16:07:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
me@box ~ $ python --version
Python 2.7.5
me@box ~ $ virtualenv --version
1.10.1
me@box ~ $ virtualenv venv
New python executable in venv/bin/python
Installing Setuptools.......................................................................................................................................................done.
Installing Pip............................................................................................................................................................................................................................................................................done.
me@box ~ $ source venv/bin/activate
(venv)me@box ~ $ mkdir target
(venv)me@box ~ $ ls
target venv
(venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev -U pip
Collecting pip
Downloading https://my_proxy:5000/root/pypi/+f/205/6f553d5b593d3/pip-8.0.2-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 14.3MB/s
Installing collected packages: pip
Found existing installation: pip 1.4.1
Uninstalling pip-1.4.1:
Successfully uninstalled pip-1.4.1
Successfully installed pip-8.0.2
(venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target pyyaml
Collecting pyyaml
Downloading https://my_proxy:5000/root/pypi/+f/89c/bc92cda979042/PyYAML-3.11.zip (371kB)
100% |████████████████████████████████| 372kB 18.6MB/s
Installing collected packages: pyyaml
Running setup.py install for pyyaml ... done
Successfully installed pyyaml
Exception:
Traceback (most recent call last):
File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpz2LoDs/lib/python'
(venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target simplejson
Collecting simplejson
Downloading https://my_proxy:5000/root/pypi/+f/b84/41f1053edd9dc/simplejson-3.8.1.tar.gz (76kB)
100% |████████████████████████████████| 77kB 19.0MB/s
Installing collected packages: simplejson
Running setup.py install for simplejson ... done
Successfully installed simplejson
Exception:
Traceback (most recent call last):
File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmpEFNOZq/lib/python'
(venv)me@box ~ $ pip install --index-url https://my_proxy:5000/dev/dev --target target markupsafe
Collecting markupsafe
Downloading https://my_proxy:5000/root/pypi/+f/f5a/b3deee4c37cd6/MarkupSafe-0.23.tar.gz
Installing collected packages: markupsafe
Running setup.py install for markupsafe ... done
Successfully installed markupsafe
Exception:
Traceback (most recent call last):
File "/data/home/me/venv/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/data/home/me/venv/lib/python2.7/site-packages/pip/commands/install.py", line 357, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmp4UuvDJ/lib/python'
(venv)me@box ~ $ ls /tmp/tmp4UuvDJ/
lib64
As you can see using --target first installs into a temporary directory and
then installes into the desired target. Well, at least it tries to: for any
packages that have c-extensions (in this case pyyaml, simplejson and
markupsafe) it incorrectly looks for a lib directory whereas it should be
looking for a lib64 directory. This patch fixes that for us by looking in a
fallback location. We can confirm that this fixes the issue for us.
Please advise.
This was automatically migrated from #3450 to reparent it to the
master
branch. Please see original pull request for any previous discussion.Original Submitter: @esc