We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sys.orig_argv
In an OSX .venv the "original" sys.orig_argv is not really original...
.venv
(.venv) % cat orig.py import sys print(sys.orig_argv) (.venv) % python orig.py ['/opt/homebrew/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python', 'orig.py'] (.venv) % which python /Users/user/git/project/.venv/bin/python
I can use os.environ["_"] but it's a workaround.
os.environ["_"]
The text was updated successfully, but these errors were encountered:
I cannot reproduce the issue on Linux.
$ python3 -m venv env $ env/bin/python -c 'import sys; print(sys.orig_argv[0])' env/bin/python $ source env/bin/activate (env) $ python -c 'import sys; print(sys.orig_argv[0])' python (env) $ which python ~/env/bin/python (env) $ ls -l env/bin/python lrwxrwxrwx 1 vstinner vstinner 7 5 oct. 22:31 env/bin/python -> python3* (env) $ ls -l env/bin/python3 lrwxrwxrwx 1 vstinner vstinner 16 5 oct. 22:31 env/bin/python3 -> /usr/bin/python3*
You can also have a look at:
(env) vstinner@mona$ python >>> import sys >>> sys.executable '/home/vstinner/env/bin/python' >>> sys._base_executable '/usr/bin/python3.12'
Sorry, something went wrong.
Yup. As I've said it's probably OSX-specific
This one is inside venv:
% python -c 'import sys; print(sys.orig_argv[0])' /opt/homebrew/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python
% python -c 'import sys; print(sys.executable, sys._base_executable)' /Users/user/git/project/.venv/bin/python /opt/homebrew/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/bin/python3.11
No branches or pull requests
In an OSX
.venv
the "original"sys.orig_argv
is not really original...I can use
os.environ["_"]
but it's a workaround.The text was updated successfully, but these errors were encountered: