Opened 4 years ago

Closed 4 years ago

#49212 closed defect (fixed)

autojump @22.2.4: ImportError: No module named autojump_argparse

Reported by: mkae (Marko Käning) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: yangyan.ssc@…, rubendibattista (Ruben Di Battista), max-arnold (Max Arnold), julian.panetta@…, jowens@…, jpenney (Jason Penney), macports.org-acnt@…
Port: autojump

Description (last modified by mkae (Marko Käning))

When I try to jump into my Downloads folder I see this:

$ j Dow
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 'Dow' not found
Try `autojump --help` for more information.

Something broke recently, perhaps due to #49102!?

Attachments (1)

Portfile-autojump.diff (2.2 KB) - added by jpenney (Jason Penney) 4 years ago.
patch for autojump Portfile

Download all attachments as: .zip

Change History (27)

comment:1 Changed 4 years ago by mkae (Marko Käning)

Cc: ryandesign@… added
Description: modified (diff)

comment:2 in reply to:  description ; Changed 4 years ago by ryandesign (Ryan Schmidt)

Cc: yangyan.ssc@… added; ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned
Summary: autojump @22.2.4 : currently broken, perhaps due to recent updateautojump @22.2.4: ImportError: No module named autojump_argparse

Replying to mk@…:

Something broke recently, perhaps due to #49102!?

Yes. That was also reported by email a couple days ago, but thank you for filing a ticket about it. I have not yet succeed in fixing this. The port currently has a custom destroot block, which was not updated for changes that apparently took place in autojump. I tried to switch the port to using the included installation script, however the script appears to be problematic in various ways that either need to be fixed or possibly we can't use the script after all and have to figure out how to fix the custom destroot block.

comment:3 in reply to:  2 Changed 4 years ago by mkae (Marko Käning)

Replying to ryandesign@…:

thank you for filing a ticket about it.

You're welcome.

OK, good to know that you try to deal with this already. :) Thanks in advance!!!

comment:4 Changed 4 years ago by rubendibattista (Ruben Di Battista)

Cc: rubendibattista@… added

Cc Me!

comment:5 Changed 4 years ago by max-arnold (Max Arnold)

Cc: lwarxx@… added

Cc Me!

comment:6 Changed 4 years ago by julian.panetta@…

Cc: julian.panetta@… added

Cc Me!

comment:7 Changed 4 years ago by jowens@…

Cc: jowens@… added

Cc Me!

comment:8 Changed 4 years ago by jpenney (Jason Penney)

Cc: jpenney@… added

Cc Me!

Changed 4 years ago by jpenney (Jason Penney)

Attachment: Portfile-autojump.diff added

patch for autojump Portfile

comment:9 Changed 4 years ago by jpenney (Jason Penney)

I've attached a patch that uses the provided install script to install into destroot, then correct the path in autojump.sh. It's working for me.

comment:10 Changed 4 years ago by jowens@…

WFM. Thanks @jpenney!

comment:11 Changed 4 years ago by rubendibattista (Ruben Di Battista)

Works also for me. Thanks.

Last edited 4 years ago by rubendibattista (Ruben Di Battista) (previous) (diff)

comment:12 Changed 4 years ago by rubendibattista (Ruben Di Battista)

No. I was too hasty.

/Users/***/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh:18: command not found: brew
/Users/***/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh:[:18: too many arguments
Last edited 4 years ago by rubendibattista (Ruben Di Battista) (previous) (diff)

comment:13 Changed 4 years ago by mkae (Marko Käning)

Committed in r14256, as it works for bash. Keeping it open in the hope that someone will fix it for ruben's zsh...

comment:14 Changed 4 years ago by macports.org-acnt@…

Seeing this in zsh using OMZ as well. The OMZ autojump "plugin" is a simple nested if that just aims to automatically select the right profile of autojump depending on whether it was installed manually or one of the various package managers out there. The actual core autojump shell setup called for MacPorts is in /opt/local/etc/profile.d, but that may be an issue here. OMZ is looking for autojump.zsh, and in an earlier MacPorts install profile.d did contain autojump.bash, autojump.sh, and autojump.zsh. However, on a brand new fresh install I'm seeing only autojump.sh and nothing else at all. @rubendibattista, are you seeing that too?

comment:15 Changed 4 years ago by macports.org-acnt@…

Cc: macports.org-acnt@… added

Cc Me!

comment:16 Changed 4 years ago by jowens@…

I remove my "works for me" (in bash). It doesn't work for me.

Also, oddly, the alias 'j' for autojump appears to have disappeared.

$ autojump foo
Please source the correct autojump file in your shell's
startup file. For more information, please reinstall autojump
and read the post installation instructions.
$ if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
>     . /opt/local/etc/profile.d/bash_completion.sh
> fi
$ ls -l /opt/local/etc/profile.d/bash_completion.sh
-rw-r--r--  1 root  admin  675 Nov  7 06:32 /opt/local/etc/profile.d/bash_completion.sh
$ autojump foo
Please source the correct autojump file in your shell's
startup file. For more information, please reinstall autojump
and read the post installation instructions.
$
Last edited 4 years ago by jowens@… (previous) (diff)

comment:17 in reply to:  16 ; Changed 4 years ago by jpenney (Jason Penney)

Replying to jowens@…:

I remove my "works for me" (in bash). It doesn't work for me.

I think you're sourcing the wrong file there (that's for bash_completion, not autojump).

$ port note autojump
autojump has the following notes:
  To use autojump for bash, add the following to the end of your .bashrc:
  
  if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
      . /opt/local/etc/profile.d/autojump.sh
  fi
  
  To use autojump for zsh, add the following to the end of your .zshrc:
  
  export FPATH="$FPATH:/opt/local/share/zsh/site-functions/"
  if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
      . /opt/local/etc/profile.d/autojump.sh
  fi
  
  To use zsh tab completion, load compinit in your .zshrc:
  
  autoload -U compinit; compinit

comment:18 in reply to:  14 Changed 4 years ago by jpenney (Jason Penney)

Replying to macports.org-acnt@…:

Seeing this in zsh using OMZ as well. The OMZ autojump "plugin" is a simple nested if that just aims to automatically select the right profile of autojump depending on whether it was installed manually or one of the various package managers out there. The actual core autojump shell setup called for MacPorts is in /opt/local/etc/profile.d, but that may be an issue here. OMZ is looking for autojump.zsh, and in an earlier MacPorts install profile.d did contain autojump.bash, autojump.sh, and autojump.zsh. However, on a brand new fresh install I'm seeing only autojump.sh and nothing else at all.

That's all you'll see on a non-macports install of the latest autojump as well. The autojump.sh file detects the current shell and loads the correct file from another location in the current version. This sounds like an OMZ issue, where it needs to be updated for the latest changes to autojump.

I just tried using zsh with the instructions autojump shows on install and it works fine for me.

comment:19 Changed 4 years ago by mkae (Marko Käning)

Can this be considered fixed and the ticket to be closed?

comment:20 in reply to:  19 Changed 4 years ago by macports.org-acnt@…

Replying to mk@…:

Can this be considered fixed and the ticket to be closed?

Yes, issue is not with MacPorts. Confirming jpenny, the problem is OMZ, a pull request should be submitted there because their plugin is out of date wrt autojump. Editing it to refer to autojump.sh seems to make everything function as it should. I think this ticket can be closed unless someone is still seeing unexpected behavior.

comment:21 Changed 4 years ago by mkae (Marko Käning)

Will you take care of the pull request there?

I guess once that is assured we can close this ticket, right!?

comment:22 in reply to:  17 Changed 4 years ago by jowens@…

a) I'm a moron b) My issue appears to have been sourcing autojump.bash rather than autojump.sh. Problem solved.

Replying to jpenney@…:

Replying to jowens@…:

I remove my "works for me" (in bash). It doesn't work for me.

I think you're sourcing the wrong file there (that's for bash_completion, not autojump).

$ port note autojump
autojump has the following notes:
  To use autojump for bash, add the following to the end of your .bashrc:
  
  if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
      . /opt/local/etc/profile.d/autojump.sh
  fi
  
  To use autojump for zsh, add the following to the end of your .zshrc:
  
  export FPATH="$FPATH:/opt/local/share/zsh/site-functions/"
  if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
      . /opt/local/etc/profile.d/autojump.sh
  fi
  
  To use zsh tab completion, load compinit in your .zshrc:
  
  autoload -U compinit; compinit

comment:23 in reply to:  14 Changed 4 years ago by rubendibattista (Ruben Di Battista)

Replying to macports.org-acnt@…:

Seeing this in zsh using OMZ as well. The OMZ autojump "plugin" is a simple nested if that just aims to automatically select the right profile of autojump depending on whether it was installed manually or one of the various package managers out there. The actual core autojump shell setup called for MacPorts is in /opt/local/etc/profile.d, but that may be an issue here. OMZ is looking for autojump.zsh, and in an earlier MacPorts install profile.d did contain autojump.bash, autojump.sh, and autojump.zsh. However, on a brand new fresh install I'm seeing only autojump.sh and nothing else at all. @rubendibattista, are you seeing that too?

Sorry. Did not have the time to check. Thanks for helping in any case.

comment:24 Changed 4 years ago by rubendibattista (Ruben Di Battista)

Opened an issue on the OMZ Github Repo: https://github.com/robbyrussell/oh-my-zsh/issues/4625

comment:25 in reply to:  21 Changed 4 years ago by macports.org-acnt@…

Replying to mk@…:

Will you take care of the pull request there?

I guess once that is assured we can close this ticket, right!?

@rubendibattista beat me to opening an issue, I'll try to put together a pull tonight if it hasn't been done already, after I can hit up a few folks on IRC who use other installs. The OMZ plugin refers to nine different installation methods (both manual and other package systems I don't use at all), worth asking around to make sure they're all updated and if it's important to maintain BC with old installations; I don't know what their policy is on breaking changes.

Given that it's a very simple quick edit (or for that matter an OMZ user can just manually include it in their .zshrc) though I'm not sure you need to keep this ticket open in the mean time. However it gets hashed out it doesn't seem like it's MacPort's issue beyond the initial bug that was already patched. Any OMZ user will hit it as they upgrade autojump through whatever method they use.

comment:26 Changed 4 years ago by mkae (Marko Käning)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.