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

Autojump fails when starting from a directory with a .python-version file #608

Open
tylucaskelley opened this issue Jul 11, 2020 · 2 comments

Comments

@tylucaskelley
Copy link

Description

Ran into an interesting issue when trying to use autojump. When starting in a directory that contains a .python-version file, which the tool pyenv uses to set a local Python version, autojump will fail if said version is not installed. Here's the error I get:

$ j down

pyenv: version `3.8.3' is not installed (set by /Users/tylucaskelley/Code/validation-service/.python-version)
autojump: directory 'down' not found
\n\n
Try `autojump --help` for more information.

If I remove the .python-version file, the issue goes away. The reason why that local version isn't installed is because I'm using the Poetry package management tool for my Python projects, so I don't actually need to install that version on my system globally.

Reproducing

Here's a minimal way to reproduce the issue (assuming autojump already installed)

  1. Install pyenv on the system
  2. Create a directory with a .python-version file in it, and set to a Python version not installed on the system
  3. Go to said directory, and try to use autojump to leave - should get the same error I did above

System info

  • macOS 10.15.5
  • autojump installed via Homebrew
  • System has pyenv installed
  • Using iTerm 2
@suzaku
Copy link

suzaku commented Nov 25, 2020

This won't be the case if autojump is not implemented in a interpreted language like Python. So I've created a project to rewrite it in Go, you may want to give it a try: https://github.com/suzaku/shonenjump

@chensterliu
Copy link

I found an easy solution here.
Basically, you just need to copy the 4 .py files from your system python (/usr...): autojump_argparse, autojump_data, autojump_match, autojump_utils to the corresponding version in .pyenv.

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

3 participants