Reputation: 135
If I type pipenv
, pipenv shell
, pipenv install
, or any other command that triggers creating a new environment, it hangs forever (tested for 10 minutes) without displaying any output at all. If I do a command where there is already a pipenv virtual environment created, it has no problem (e.g. updating from the Pipfile or running the shell). I suspect the problem is specific to running on WSL Ubuntu (Ubuntu subsystem for Windows), but I'm not sure how to verify that.
The reason I was able to verify that pipenv commands worked fine on an existing pipenv virtual environment was because I didn't have this problem a few months ago, and I already had a successfully created virtual environment. I ran into this problem today when trying to create an environment for a new project. But after removing the virtual environment in the still working project and trying to re-create that environment, it failed the same way as it did for the new project. Hanging with no output.
pyenv
is confirmed to work.
Output of pyenv versions
(both projects have python_full_version
set to something in this list):
system
3.7.10
* 3.8.12 (set by /home/dcripplinger/.pyenv/version)
Output of which pipenv
(also confirmed there is not a duplicate pipenv installed with apt):
/home/dcripplinger/.local/bin/pipenv
pipenv
was installed with pip install --user pipenv
, which I believe lines up correctly with the above location. I also confirmed there is not currently a duplicate pipenv installed with apt (although there used to be).
Output of pip --version
(indicating it's using the correct global pyenv):
pip 21.1.1 from /home/dcripplinger/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pip (python 3.8)
Output of virtualenv --version
:
virtualenv 20.9.0 from /home/dcripplinger/.local/lib/python3.8/site-packages/virtualenv/__init__.py
This is not related to the Pipfile or Pipfile.lock in the two projects because the same thing happens in a new folder making a blank environment with a simple command like pipenv --three
.
Upvotes: 3
Views: 1202
Reputation: 516
Declaring python didn't make any difference to me, but setting this variable fixed the problem:
SETUPTOOLS_USE_DISTUTILS=stdlib pipenv install
Note: It takes some time to get going and doesn't output right away so wait a few minutes before giving up on it!
Upvotes: 1
Reputation: 1123
It looks like one needs to declare the python version first (even though I've got it declared in the Pipfile already :shrug:).
e.g.
pipenv --python 3.6
And only then
pipenv install
(fwiw: I actually had to sudo
both of those, but, I assume that's not best practice).
Upvotes: 1