Sửa lỗi no such file or directory ubuntu

Khi tạo project Laravel bằng công cụ “Composer Project” của PHPStorm, mình gặp một lỗi trên Ubuntu:

ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory

Sửa lỗi no such file or directory ubuntu

Để khắc phục lỗi này, chúng ta sử dụng command sau:

Trên Ubuntu /Debian

sudo apt -y install ssh-askpass

Trên RHEL / CentOS

sudo yum -y install ssh-askpass

Nguồn: vinasupport.com

Cách khắc phục: Phía trước dòng chữ No such file or directory chính là tên tập tin hoặc thư mục bị khai báo sai (stdo.h) và màu đỏ cảnh báo có lỗi của Code::Blocks cũng chỉ ngay dòng lệnh có lỗi (dòng 1). Chúng ta đã tìm ra nguyên nhân sai, bây giờ bạn chỉ cần sửa lại cho đúng tên tập tin được include thôi. Sửa stdo.h thành stdio.h

Kinh nghiệm: click vào +1 hoặc like xem kinh nghiệm xử lý khi gặp lỗi

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:

/usr/bin/env: ‘python’: No such file or directory

Possible Solution

1

  • If Python 3 is not installed, install it:

    sudo apt update sudo apt install python-is-python3

    0

Possible Solution

2

  • If Python 3 has been installed, run these commands:

    sudo apt update sudo apt install python-is-python3

    1
  • Then we create a symlink to it:

    sudo apt update sudo apt install python-is-python3

    2

EDIT: hi everyone, I noticed that @mchid posted a better solution below my answer:

sudo apt update
sudo apt install python-is-python3

3.

answered May 5, 2020 at 7:43

Sửa lỗi no such file or directory ubuntu

11

On Ubuntu 20.04 and newer, there is a package to fix this problem. Run the following commands:

sudo apt update
sudo apt install python-is-python3

Run

sudo apt update
sudo apt install python-is-python3

4 for more info.

answered Nov 29, 2020 at 12:16

Sửa lỗi no such file or directory ubuntu

mchidmchid

2,8091 gold badge14 silver badges12 bronze badges

7

Having been momentarily stumped by this error myself, I thought I'd post how I fixed my problem.

My problem was an error:

: No such file or directory

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,9661 gold badge20 silver badges35 bronze badges

4

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, 2022 at 22:03

NormanNorman

3,10523 silver badges22 bronze badges

2

For people facing the same issue with MacOS and installed python3 with homebrew:

sudo ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python

answered May 23, 2022 at 15:45

Sửa lỗi no such file or directory ubuntu

DanielMDanielM

3,7036 gold badges40 silver badges54 bronze badges

2

For those with macOS or M1 machines (tested on 12.5) symlinking /usr/bin/python3 will not work because it's a reference to the xcode python3 installation. Instead do:

sudo apt update
sudo apt install python-is-python3

5

answered Jan 25 at 20:24

AlexAlex

3,5114 gold badges18 silver badges32 bronze badges

@mchid's answer is the one you should go for it.

just FYI,

if you do this:

sudo apt update
sudo apt install python-is-python3

6

it will say

sudo apt update
sudo apt install python-is-python3

7

But if you do this:

sudo apt update
sudo apt install python-is-python3

8, it should work.

So, just modify the shebang line

from

sudo apt update
sudo apt install python-is-python3

9 to

: No such file or directory

0, you're good to go.

(which is automatically done by doing

sudo apt update
sudo apt install python-is-python3

3)

Sửa lỗi no such file or directory ubuntu

mchid

2,8091 gold badge14 silver badges12 bronze badges

answered Mar 7, 2021 at 3:36

Sửa lỗi no such file or directory ubuntu

starrietstarriet

2,90623 silver badges24 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:

sudo ln -s /usr/bin/python3 /usr/bin/python

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:

repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M

you can see document in Downloading the Source

answered Mar 19, 2022 at 12:54

Sửa lỗi no such file or directory ubuntu

e.moradie.moradi

791 silver badge6 bronze badges

1

creating a symbolic link solved the issue for me

sudo ln -s /usr/bin/python3 /usr/bin/python

answered Dec 5, 2022 at 12:12

Sửa lỗi no such file or directory ubuntu

Additional possible solution if the other suggestions from the mates are not working is to convert the

: No such file or directory

2 scripts into UNIX format.

You can do so by installing dos2unix, before converting your scripts. You can do with something like this:

sudo apt install dos2unix

Once installed, you can convert your script accordingly:

dos2unix <filename>.py

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.