Skip to content
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

Location of the command is not updated after installing a package with executables in virtualenv (only in Python 2) #4363

Closed
irushchyshyn opened this issue Mar 22, 2017 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality

Comments

@irushchyshyn
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating system: Fedora 25

Description:

When one installs any package with an executable in a virtualenv using pip, the location of the executable is not updated in the hash right away. It gets updated only after reactivating the virtualenv or running hash -r to make shell forget all remembered locations.

The issue has already been reported in virtualenv (pypa/virtualenv#41), and hash -r is the only solution so far. Should not pip update the locations?

The issue applies only for Python2. I am using pytest as an example below:

What I've run:

$ virtualenv vv
Installing setuptools, pip, wheel...done.
$ . vv/bin/activate
(vv) $ py.test --version
This is pytest version 2.9.2, imported from /usr/lib/python2.7/site-packages/pytest.pyc
(vv) $ pip install pytest
...
Successfully installed py-1.4.33 pytest-3.0.7
(vv) $ which pytest
~/vv/bin/pytest
(vv) $ py.test --version
This is pytest version 2.9.2, imported from /usr/lib/python2.7/site-packages/pytest.pyc
(vv) $ ~/vv/bin/pytest --version
This is pytest version 3.0.7, imported from /home/ishcherb/vv/lib/python2.7/site-packages/pytest.pyc
(vv) $ pip --version
pip 9.0.1 from /home/ishcherb/vv/lib/python2.7/site-packages (python 2.7)
(vv) $ hash -r 
(vv) $ py.test --version
This is pytest version 3.0.7, imported from /home/ishcherb/vv/lib/python2.7/site-packages/pytest.pyc
@xavfernandez xavfernandez added the type: enhancement Improvements to functionality label Mar 22, 2017
@chrahunt
Copy link
Member

We're tracking a help message update in #6863 that would narrow the window on these sorts of edge cases. There also doesn't seem to be a way for a non-shell-function to actually perform the rehash. I will close this issue eagerly in favor of #6863 (since we can't implement the hash update directly ourselves).

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 15, 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 type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

3 participants