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

ImportError: No module named autojump_argparse #388

Open
rsparkyc opened this issue Oct 19, 2015 · 16 comments
Open

ImportError: No module named autojump_argparse #388

rsparkyc opened this issue Oct 19, 2015 · 16 comments

Comments

@rsparkyc
Copy link

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.
@campbellC
Copy link

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.

@jpenney
Copy link

jpenney commented Nov 3, 2015

See macports ticket #49212

@gled-rs
Copy link

gled-rs commented Nov 10, 2015

it also happens when working with virtualenvs...

I had to hook my zsh to disable autojump when in a virtualenv to avoid this message...

@greatluke
Copy link

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"

@tigerjack
Copy link

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.

@greatluke
Copy link

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"?

@tigerjack
Copy link

tigerjack commented Dec 11, 2020

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.

@greatluke
Copy link

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.

@mrever
Copy link

mrever commented Dec 30, 2020

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.

@xtreemrage
Copy link

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.

@roeniss
Copy link

roeniss commented May 9, 2021

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?

@ceuk
Copy link

ceuk commented Nov 26, 2021

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

@0x89b217
Copy link

  1. git clone https://github.com/wting/autojump
  2. python -V
  3. sudo cp autojump/bin/autojump_* /usr/lib/python [your python version] /site-packages/

@isidroas
Copy link

isidroas commented Jun 1, 2023

In Ubuntu 22.04 I had to make a symbolic link

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

@jbagot
Copy link

jbagot commented Jun 27, 2023

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

@rivalak
Copy link

rivalak commented Jun 30, 2023

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

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