Autojump: ImportError: No module named autojump_argparse

Created on 19 Oct 2015  ·  11Comments  ·  Source: wting/autojump

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.

Most helpful comment

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.

All 11 comments

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:
1) Directory of the file autojump_argparse.py?
2) 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 the 3.9 directory (i.e. the freshly updated python version). I don't know autojump 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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanyutou picture shanyutou  ·  3Comments

davux picture davux  ·  9Comments

srid picture srid  ·  14Comments

dotimes picture dotimes  ·  4Comments

shepherdwind picture shepherdwind  ·  11Comments