Usr/bin/env python: no such file or directory
I update the kernel, after that the Ubuntu doesn't work well, PS: I try to exec "meld" command, it will report that "/usr/bin/env: python: No such file or directory", then I exec "sudo apt-get install python" and get the result "python is already the newest version.", what should I do for it. I'm not good at linux, can you tell me how to revert my linux to the last right status, or reinstall the python normally.
asked Sep 7, 2010 at 2:06
4 Problem scenario:
Possible Solution #1
Possible Solution #2
EDIT: hi everyone, I
noticed that @mchid posted a better solution below my answer:
answered May 5, 2020 at 7:43
13 On Ubuntu 20.04 and newer, there is a package to fix this problem. Run the following commands:
Run answered Nov 29, 2020 at 12:16
mchidmchid 1,9291 gold badge13 silver badges11 bronze badges 3 Having been momentarily stumped by this error myself, I thought I'd post how I fixed my problem. My problem was an error:
Which made little sense to me. My problem is that my editor had silently converted the script from Unix LF to Windows CR/LF line-termination. A rather unfortunate upshot of this is that "#!/usr/bin/env python" actually became "#!/usr/bin/env python\015" where \015 is the invisible CR character... /usr/bin/env was, then, unable to find a command "python\015" - hence the file-not-found error. Converting the script to Unix line-ending convention solved my problem... but only after a few minutes' head-scratching. answered Jan 4, 2012 at 23:32
aSteveaSteve 1,9761 gold badge20 silver badges34 bronze badges 6 May 2022: For anyone who just updated to Monterey 12.3 it appears the update replaces python with python3. Downloading python fixes the issues in Xcode and git command line. Be sure to read the two comments below. answered Mar 29 at 22:03
NormanNorman 2,68821 silver badges21 bronze badges 2 @mchid's answer is the one you should go for it. just FYI, if you do this: it will say But if you do this: So, just modify the shebang line from (which is automatically done by doing answered Mar 7, 2021 at 3:36
starrietstarriet 1,44716 silver badges18 bronze badges 1 For people facing the same issue with MacOS and installed python3 with homebrew:
answered May 23 at 15:45
DanielMDanielM 2,9295 gold badges30 silver badges44 bronze badges 1 This answer for android build system error For Python 3 If you get a "/usr/bin/env 'python' no such file or directory" error message, use one of the following solutions: If your Ubuntu 20.04.2 LTS is a newly installed (vs. upgraded) Linux version:
f using Git version 2.19 or greater, you can specify --partial-clone when performing repo init. This makes use of Git's partial clone capability to only download Git objects when needed, instead of downloading everything. Because using partial clones means that many operations must communicate with the server, use the following if you're a developer and you're using a network with low latency:
you can see document in Downloading the Source answered Mar 19 at 12:54
Additional possible solution if the other suggestions from the mates are not working is to convert the You can do so by installing dos2unix, before converting your scripts. You can do with something like this:
Once installed, you can convert your script accordingly:
You can read more here about dos2unix. -- Separately, do try to run your script locally and see if it's working, you will also need to take note to include the hashbang in your script.
answered Jun 7 at 1:37
ahjim0m0ahjim0m0 841 silver badge5 bronze badges |