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.

pipx upgrade replaces `.` with `-` in path

See original GitHub issue

Background

I have a setup where machines with different OSs share the home folder, and I want to install a package to be run on all of them, so in ~/.bashrc I set different pipx folders for each OS case and I install different versions of pipx in each:

# pipx handling, added 2022-06-20
OS=`lsb_release -si`_`lsb_release -sr`
case $OS in
RedHatEnterprise_8.5) # r8
  export PIPX_HOME=$HOME/.local-rel8
  echo "Pippo"
  export PIPX_DEFAULT_PYTHON=/modules/rhel8/user-apps/python/python-3.10.4/bin/python3 
  ;;
Ubuntu_18.04) # bionic
  export PIPX_HOME=$HOME/.local-bionic
  export PIPX_DEFAULT_PYTHON=/modules/bionic/user-apps/python/python-3.7.3/bin/python3 
  ;;
CentOS_7*) # centos7
  export PIPX_HOME=$HOME/.local-centos7
  export PIPX_DEFAULT_PYTHON=/modules/centos7/user-apps/python/python-3.7.3/bin/python3 
  ;;
*) # otherwise
  echo "no known OS" 
  ;;
esac
export PIPX_BIN_DIR=$PIPX_HOME/bin

then to install the package I run on each machine respectively :

~/.local-r8/bin/pipx install [mypackageurl]
~/.local-centos/bin/pipx install  [mypackageurl]
~/.local-bionic/bin/pipx install [mypackageurl]

which makes it available where it should be :

~/.local-r8/bin/[mycommand]
~/.local-centos/bin/[mycommand]
~/.local-bionic/bin/[mycommand]

Problem the issue I have is when I need to upgrade the package, if I try for example
~/.local-r8/bin/pipx upgrade ~/.local-r8/bin/[mycommand] --verbose
what I get is :

pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is '/modules/rhel8/user-apps/python/python-3.10.4/bin/python3'
pipx >(run_pipx_command:169): Virtual Environment location is ~/-local-r8/bin/[mycommand]
Package is not installed. Expected to find ~/-local-r8/bin/[mycommand], but it does not exist.

so the . in .local-r8 is replaced by -

I can still upgrade with forcing a reinstall, for example ~/.local-r8/bin/pipx install --force [mypackageurl]
but I was wondering if this is as intended, and I am doing something wrong, or if there’s a bug somewhere

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
charlienegricommented, Jul 22, 2022

I guess this closes this issue, thanks for the follow up

0reactions
charlienegricommented, Jul 22, 2022

I see, since the command is not in path I thought I had to pass its full path, but running
~/.local-[r8|centos7|bionic]/bin/pipx upgrade [mycommand]
indeed works…

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipx — Install and Run Python Applications in Isolated ...
Upgrade pipx with python3 -m pip install --user -U pipx . ... If you installed python using the app-store, replace `python` with `python3`...
Read more >
How do I install a Python command line tool or script? (hint: pipx)
pipx upgrade -all - upgrades all packages installed with pipx; pipx list - shows all the packages installed and path information; pipx run ......
Read more >
python - PIPX install path change - Stack Overflow
Uninstall pipx with pip uninstall pipx . Then remove the $home/.local/pipx directory completely. Use get-command pipx in a PowerShell prompt ...
Read more >
Python Virtual Environments: A Primer
You should consider upgrading via the 'C:\Users\Name\path\to\venv\Scripts\python.exe -m pip install --upgrade pip' command.
Read more >
Pipx : Python CLI package tool - GeeksforGeeks
Downloading and Installing Pandas · install Install a package · inject Install packages into an existing Virtual Environment · upgrade Upgrade a ...
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