virtualenv hung up on installing setuptools
Use the -v
switch to get Verbose output.
For me, it was a network connection. Specifically, the server I was trying to use virtualenv
on was firewalled from the Internet and I needed to get out thru a proxy. Except, that virtualenv doesn't seem to honor the proxy settings in the environment and it has no commandline switch.
So use pip
to pre-cache/pre-download the 3 needed packages:
sudo pip download setuptools pip wheel --proxy http://<yourproxyhere>
Then you can run virtualenv
and it will use the cached packages that you just downloaded.
I was using pipenv to install a venv :
$ pipenv installCreating a virtualenv for this project…Pipfile: /home/seba/Sources/neogeo/grandlyon/photon-setup/PipfileUsing /usr/bin/python3 (3.6.7) to create virtualenv…⠦ Creating virtual environment...
Verbose mode didn't give me more information, --clear
was useless but using ps auxf
I saw the oython process was waiting for nothing:
[...] S+ 09:59 0:00 | | \_ /home/seba/Sources/neogeo/grandlyon/photon-setup/venv/bin/python3 - setuptools pip wheel
It stalled installing setuptools.
Creating a virtualenv as usual confirmed me this:
$ virtualenv -vv --python=python3 venv[...]Running command /home/seba/Sources/n...tup/venv/bin/python3 - setuptools pip wheelLooking in links: /usr/local/lib/python3.6/dist-packages/virtualenv_supportCollecting setuptools[Waiting forever]
The fix was dropping pip cache:
$ rm -Rf ~/.cache/pip/ ~/.cache/pip-tools/
I ran into this as well and none of the answers above worked. Turned out to be a bad cache entry.
With $ virtualenv -vv venv
I'd get output ending with:
Running command /Users/ghartmann/cod...test/venv/bin/python - setuptools pip wheelCollecting setuptools Cache entry deserialization failed, entry ignored
It would block there and then when you interrupted you'd see the stack indicating it was blocked downloading the wheel
package.
On macos the pip cache is here: ~/Library/Caches/pip
.
Removing that directory fixed the issue, as it was able to reinitialize the cache.