Skip to content
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

‘python’: No such file or directory #577

Closed
aborruso opened this issue May 26, 2019 · 11 comments
Closed

‘python’: No such file or directory #577

aborruso opened this issue May 26, 2019 · 11 comments

Comments

@aborruso
Copy link

Hi,
I have installed it and added to ~/.zshrc

[[ -s /home/aborruso/.autojump/etc/profile.d/autojump.sh ]] && source /home/aborruso/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

But not, using my shell I have always: "/usr/bin/env: ‘python’: No such file or directory"

I have python3

@th1nk3r-ing
Copy link

th1nk3r-ing commented Oct 11, 2019

Hi, man, i just fix it.
Because WSL installed python3 while autojump use python in ~/.autojump/autojump
so, you can do this :
install python or sed -i "s/\#\!\/usr\/bin\/env\ python/\#\!\/usr\/bin\/env\ python3/" ~/.autojump/bin/autojump

@aborruso
Copy link
Author

it works, thank you very much

@hemantg05
Copy link

I had same issue on Macbook Pro M1 (MacOS Monterey 12.4).

I was able to solve it by installing older version of python from here.
https://www.python.org/downloads/release/python-2718/

@Norcy
Copy link

Norcy commented Jun 30, 2022

Hi, man, i just fix it. Because WSL installed python3 while autojump use python in ~/.autojump/autojump so, you can do this : install python or sed -i "s/\#\!\/usr\/bin\/env\ python/\#\!\/usr\/bin\/env\ python3/" ~/.autojump/bin/autojump

This not work for me, because there isn't ~/.autojump/ directory in my case

When i type python in terminal, it get a zsh: command not found: python tips

Finally, adding a soft link to python3 works for me

ln -s -f /usr/local/bin/python3 /usr/local/bin/python

@th1nk3r-ing
Copy link

th1nk3r-ing commented Jun 30, 2022

  1. I do not recommend you to do this, because such changes will affect other programs using python2.
  2. The best way is still to find the .autojump folder and change the python version used by the internal scripts.
  3. U can try whereis autojump to find the .autojump dir-location

PS: 都是中国人, 你为啥用英语?

@Norcy
Copy link

Norcy commented Jun 30, 2022

原来是中国人,看都是英语在讨论。。写英语太难了。。

我发现不止有这个问题,我的 alfred 脚本都坏了,准备过来修改回答了。

然后你说的这个方法我试了,可行。

我用 which autojump 然后 cat 下,里面有个路径,修改下这个文件的 python 就可以了

感谢

@aindriu80
Copy link

Thanks - This worked for me (Pop 22.04 & ZSH)

Needed the following in .zshrc

   #AutoJump
   [[ -s /home/aindriu/.autojump/etc/profile.d/autojump.sh ]] && source /home/aindriu/.autojump/etc/profile.d/autojump.sh
   
     autoload -U compinit && compinit -u

and then the following as I have python3 instead of python
sed -i "s/\#\!\/usr\/bin\/env\ python/\#\!\/usr\/bin\/env\ python3/" ~/.autojump/bin/autojump

@bellondr
Copy link

bellondr commented Aug 2, 2022

it works for me.
autojump默认使用python2, m1默认是Python3,只需要改which autojump 这个文件的首行,改为python3就可以。

@zjdznl
Copy link

zjdznl commented Sep 13, 2022

it works for me. autojump默认使用python2, m1默认是Python3,只需要改which autojump 这个文件的首行,改为python3就可以。

it works for me.in my mac(MacBook Pro (16-inch, 2019), 12.5.1 ), the file is in /usr/local/Cellar/autojump/22.5.3/libexec/bin/autojump

@lan-mao
Copy link

lan-mao commented Dec 17, 2022

I have modified it based on these suggestions, but reported an error at runtime.

Failed to execute process '/root/.autojump/bin/autojump'. Reason:
exec: unknown error (errno was 13)

After testing, I found that this may require installation: python-is-python3. In this way, there is no need to modify the file.

My system version is :Ubuntu 22.04

@JohnRoosevelt
Copy link

之前mac上一直用 j [文件夹路径] 可以快速跳到文件夹目录,有一年多不能用没心思去管它,今天想快捷跳转试了几次不能用。查了资料修复了,github 上在说都是中国人,非要写英文为难中国人,其实这也不全怪写英文的,因为你用的操作系统代码全是英文写的。

记录下我的修复过程:
which autojump
得到 j 命令简写软链接
cat /usr/local/bin/autojump
cat 后面地址跟的是上一步的输入结果
vi /usr/local/Cellar/autojump/22.5.3/libexec/bin/autojump
vi 后面的地址是上一个 cat 命令输入内容 exec 后面引号里面的字符
打开 vi 编辑把第一行的 python 改为 python3.

因为 mac 系统更新把原来的 python2 目录移除掉了,现在在 mac 中使用 python 要改为命令 python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants