autojump
autojump copied to clipboard
ImportError: No module named autojump_argparse
After upgrading to El Capitan and following the instructions to upgrade my macports installation, autojump no longer works. I get the following error when trying to do anything:
$ j phone
Traceback (most recent call last):
File "/opt/local/bin/autojump", line 41, in <module>
from autojump_argparse import ArgumentParser
ImportError: No module named autojump_argparse
autojump: directory 'phone' not found
Try `autojump --help` for more information.
I had the same issue. Following the instructions for a manual install works perfectly so I would guess this is a problem with the macports package.
See macports ticket #49212
it also happens when working with virtualenvs...
I had to hook my zsh to disable autojump when in a virtualenv to avoid this message...
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
I'm using pyenv on Arch and unfortunately your solution didn't work for me.
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
I'm using pyenv on Arch and unfortunately your solution didn't work for me.
Can you tell me:
- Directory of the file autojump_argparse.py?
- Ouput of "echo $PATH"?
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
I'm using pyenv on Arch and unfortunately your solution didn't work for me.
Can you tell me:
1. Directory of the file autojump_argparse.py? 2. Ouput of "echo $PATH"?
Hey @greatluke, I ended up removing the package. But I correctly remember that the file was under /usr/lib/python3.9/site-packages
, while all the other python packages were under the 3.9
directory (i.e. the freshly updated python version). I don't know autojump
didn't get updated.
EDIT: I've just noticed that I made a typo for the directory name; it was /usr/lib/python3.8/site-packages
for autojump.
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
I'm using pyenv on Arch and unfortunately your solution didn't work for me.
Can you tell me:
1. Directory of the file autojump_argparse.py? 2. Ouput of "echo $PATH"?
Hey @greatluke, I ended up removing the package. But I correctly remember that the file was under
/usr/lib/python3.9/site-packages
, while all the other python packages were under the3.9
directory (i.e. the freshly updated python version). I don't knowautojump
didn't get updated.
Actually the easiest solution is to move 4 .py files: autojump_argparse, autojump_data, autojump_match, autojump_utils to the directory of the python version that you are using.
FWIW, I'm running Manjaro Xfce and my autojump broke when I did a system update (which included getting Python 3.9).
I solved it as so: pacman -Rns autojump
Then I rebuilt/installed autojump from the AUR (git clone ... cd ... makepkg -si) (I got autojump from the AUR in the first place).
Not sure if if mattered, but I also made the change "#!/usr/bin/python3" --> "#!/usr/bin/env python" in /usr/bin/autojump.
Now it's working again.
FWIW, I'm running Manjaro Xfce and my autojump broke when I did a system update (which included getting Python 3.9).
I solved it as so: pacman -Rns autojump
Then I rebuilt/installed autojump from the AUR (git clone ... cd ... makepkg -si) (I got autojump from the AUR in the first place).
Not sure if if mattered, but I also made the change "#!/usr/bin/python3" --> "#!/usr/bin/env python" in /usr/bin/autojump.
Now it's working again.
I just removed it and reinstalled it via AUR and it works for me. I didn't change anything else.
I met a very weird situation about this.
Below is a part of my init_script.
apt install python &&\
mkdir -p $DIR/tmp &&\
git clone --depth 1 https://github.com/wting/autojump.git $DIR/tmp/ &&\
$DIR/tmp/install.py &&\
rm -rf $DIR/tmp
I tried this with zsh & oh-my-zsh settings. but it fails:
ImportError: No module named autojump_argparse
However, I succeed when I executed install.py
from its directory.
apt install python &&\
mkdir -p $DIR/tmp &&\
git clone --depth 1 https://github.com/wting/autojump.git $DIR/tmp/ &&\
cd $DIR/tmp &&\
$DIR/tmp/install.py &&\
cd - &&\
rm -rf $DIR/tmp
Would it be a key to solve this problem?
I'm using virtualenvs on Manjaro KDE and this recently happens to me. Edit the first line of the file /usr/bin/autojump to point to the correct interpreter for which autojump_argparse is installed "#!/usr/bin/python3" --> "#!/usr/bin/env python"
For me #!/usr/bin/env python
wasn't sufficient I had to change the shebang to the output of which python
(which in my case was /usr/bin/pythonso:
#!/usr/bin/python` - not ideal but works perfectly both in and outside of a virtualenv
- git clone https://github.com/wting/autojump
- python -V
- sudo cp autojump/bin/autojump_* /usr/lib/python [your python version] /site-packages/
In Ubuntu 22.04 I had to make a symbolic link
sudo ln -s /usr/bin/python3 /usr/local/bin/python
I have a manjaro and it happened after a system update. To solve it:
yay -S autojump
when ask to build select "All" and thats it. autojump is reinstalled and works again
In case someone still has this issue, autojump-rs
, the rust version of autojump does not have this issue.
yay -R autojump
yay -S autojump-rs