-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
On Linux, You Have To Manually Change The Shebang On x.py From Python To Python3 #75034
Comments
Do you mean that by default CentOS use python as python3? |
There is unfortunately not a universal python shebang - windows never has python3 IIRC, and Ubuntu at least doesn't by default have a python these days. If you have concrete proposals on how to make this work, I would love to hear them - a compiler team MCP is the way to go to propose such a change. |
@nishantc1527 You can either use |
|
@K900 Rust supports both Python 2 and Python 3. |
If there isn't an automated way to detect this (at least I can't thing of anything), then can the team update the documentation on how to install rust from source? It took me a while to figure out what was happening, and I believe someone smarter than me (which includes a lot of people) can get confused to. |
Cc #71818: latest Ubuntu also does not have So longer-term, I think it is clear that this should become |
An alternative option would be to provide some sort of a wrapper script ( PYTHON=`which python3 || which python2 || which python` 2>/dev/null
"${PYTHON}" ./x.py $@ |
Closing as duplicate of #71818 |
Currently, this is the first line in
x.py
.However, on linux since it is
python3
by default when you install python (at least on centos), I have to manually change it to this every time I clone this repository.Is there some way that there is an automated way to detect this? If not, maybe you can update the docs because it took me a while to figure out what was going wrong.
The text was updated successfully, but these errors were encountered: