pipx icon indicating copy to clipboard operation
pipx copied to clipboard

use virtualenv instead of python -m venv for ubuntu installation

Open shelper opened this issue 3 years ago • 5 comments
trafficstars

I don't have sudo access on ubuntu 20.04 and i try to use pipx to setup some tools for me, e.g., pipx install poetry. However, I got error

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.8-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/username/.local/pipx/shared/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']


'/usr/bin/python3 -m venv --clear /home/username/.local/pipx/shared' failed

Later I figured out that i need to use virtualenv instead of /usr/bin/python3 -m venv., so i first run virtualenv --clear /home/username/.local/pipx/shared, then run pipx install poetry, everything worked.

So the feature i am requesting is to add suppor to use virtualenv tool directly so pipx works on ubuntu without this error of ensurepip not found

shelper avatar Jun 15 '22 15:06 shelper

PR welcome.

gaborbernat avatar Dec 02 '23 17:12 gaborbernat

I am interested in this issue and maybe a further question would be whether we should have virtualenv as dependency of pipx, or maybe optional dependency? Otherwise, it may not seem to be so meaningful to fallback to virtualenv when it is not installed with pipx?

huxuan avatar Apr 30 '24 06:04 huxuan