question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add pyenv compatibility

See original GitHub issue

I’ve got a CLI-tool (tmux-res) I built for handling some common tasks in my TMUX-environment which I built a while back. For fun I wanted to try installing it via pipx but it doesn’t work.

This is the package: https://pypi.org/project/tmux-res/

 $ pyenv global 3.7.2
 $ python --version
Python 3.7.2

 $ pipx install tmux-res
  Could not find a version that satisfies the requirement tmux-res (from versions: )
No matching distribution found for tmux-res
'/Users/hultner/.local/pipx/venvs/tmux-res/bin/python -m pip install tmux-res -q' failed

 $ pip install tmux-res
Collecting tmux-res
  Downloading https://files.pythonhosted.org/packages/09/80/a0294c244aebbdc9f13c06b182a7c1857618da20eabd1c88c4f449dbdf09/tmux_res-0.4.8-py3-none-any.whl
Collecting python-dotenv (from tmux-res)
  Downloading https://files.pythonhosted.org/packages/8c/14/501508b016e7b1ad0eb91bba581e66ad9bfc7c66fcacbb580eaf9bc38458/python_dotenv-0.10.1-py2.py3-none-any.whl
Collecting Click (from tmux-res)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Installing collected packages: python-dotenv, Click, tmux-res
Successfully installed Click-7.0 python-dotenv-0.10.1 tmux-res-0.4.8
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
cs01commented, Oct 21, 2019

pipx is like any other python package with an entry point. If you run which pipx you’ll get a path that gets executed. I get

>> which pipx
/home/csmith/.local/bin/pipx

At the top of /home/csmith/.local/bin/pipx is #!/usr/bin/python3.6 since I installed with python3.6 -m pip install --user pipx.

If I change it to #!/usr/bin/python3.7 it will try to use 3.7 and will search the site-packages directory for python3.7, and will fail since it was installed for python3.6.

Installing it with 3.7 and then trying again works fine. And subsequent packages are installed with the newer version since that’s what the pipx executable file runs at startup: /usr/bin/python3.7.

> python3.6 -m pip install pipx --user
> pipx install black
> python3.6 -m pip uninstall pipx
> python3.7 -m pip install pipx --user
> pipx install pycowsay
> pipx list
venvs are in /home/csmith/.local/pipx/venvs
apps are exposed on your $PATH at /home/csmith/.local/bin
   package black 19.3b0, Python 3.6.8
    - black
    - blackd
   package pycowsay 0.0.0.1, Python 3.7.3
    - pycowsay

2reactions
cs01commented, Mar 19, 2019

Having the default behaviour configurable via a environment variable coupled with appropriate documentation sounds like the best solution then from my point of view then.I could give it a shot if it’s okay.

Sounds good! Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Multiple Python Versions With pyenv
In this step-by-step tutorial, you'll learn how to install multiple Python versions and switch between them with ease, including project-specific virtual ...
Read more >
Add pyenv compatibility · Issue #113 · pypa/pipx - GitHub
So I think you have two fixes available: 1: specify the version explicitly when you install, or 2: reinstall pipx with python3.7 so...
Read more >
Use Pyenv to Streamline your Python Projects - Nicky Marino
If you're using a zsh shell, run these commands to add pyenv to your dot files. ... The rest are python vs python3...
Read more >
pyenv for Windows - GitHub Pages
pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple,...
Read more >
Install Python on macOS 11 M1 (Apple Silicon) using pyenv
Install pyenv on macOS 11 (Apple Silicon) · Via Homebrew: this is the quickest way. Unfortunately I could not make pyenv works as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found