-
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
pip install virtualenv
embeds absolute path to Python interpreter
#5048
Comments
That's correct and by design. Resolving from
You don't explain how the Python interpreter "went away", but if you uninstall and reinstall a Python installation, you should be uninstalling and reinstalling any packages as well. And moving a Python installation (via OS commands rather than reinstall) isn't supported by Python. |
For future visitors, the immediate fix is: pip uninstall virtualenv && pip install virtualenv I have since found that my Python interpreter at Apparently, (Arguably, the root problem is the Python community's decision to release a new programming language under a name which was already taken.) |
This is something that has occurred due to a change downstream, by Homebrew, to your system configuration. I don't see anything actionable here from pip's end. Feel free to close this @jameshfisher! :) |
See also: Homebrew/homebrew-core#25060 |
Homebrew have reversed their decision to make I still see it as weird that |
Hi, Homebrew lead maintainer here 👋. Obviously it's up to Homebrew does all it can to address this by ensuring that applications are exposed to the symlinked paths and rewriting things which refer to the |
Hmm, I don't remember calling realpath on hashbang lines, I think we just use the value of |
What we (technically distlib, as we just vendor distlib for console script handling) do is put If Homebrew wants to have scripts link to a generic name, they could patch |
@dstufft I have
|
It look me a long time to stumble upon this! I'm having the same problem with clean installs
|
Looks like this is why
|
Thanks, this is helpful and explains the issues here 👍 |
Sorry but I don't think it's using
but
|
To be clear, I'm having a problem outside of virtualenv |
I think we should have a new issue for any further discussions here. |
If anyone finds their way here by searching for the error, there is an easier solution if you keep both Python 2.x and Python 3.x on your system. Homebrew Python 2 keeps your pip installed packages in > which python
/usr/local/bin/python or > which python2
/usr/local/bin/python2 Update the hash-bang to one of the above values and everything works. |
Kudos to @foresmac . Editing |
Antes de instalar Django vamos a crear nuestro entorno virtual, para ello realizamos el siguiente #mkvirtualenv -p /usr/bin/python2.7 proyecto. listo en mi caso fue estos que me decías que The path /usr/local/bin/python2.7 (from --python=/usr/local/bin/python3.6) does not exist me faltava el puntu al final. |
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. |
Pip version:
Python version:
Operating system: macOS 10.13.3
Description:
This morning, when I ran
virtualenv
, I got this:virtualenv
only started behaving this way today. It worked yesterday. It broke becausevirtualenv
is a Python script which embeds the absolute path to a Python interpreter which went away:It appears that this absolute path is generated dynamically! After
pip uninstall virtualenv && pipinstall virtualenv
, I get a new absolute path to a new Python interpreter:This behavior is not idiomatic, and causes pip-installed packages to break in confusing ways when the path to the interpreter changes!
The idiomatic behavior is for
virtualenv
to resolve Python from myPATH
at runtime, not at install time. For example, the script could begin with a portable interpreter command, e.g.#!/usr/bin/env python
. Why is this not the case?The text was updated successfully, but these errors were encountered: