Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip hangs on installing packages

I'm using django in a virtual environment. I'm using powershell and trying to install pyopenssl.

Inside Virtual environment:

pip version = 19.2.3

python version = 3.8.3

Outside Virtual environment:

pip version = 21.2.4

python version = 3.8.3

I tried to upgrade pip inside virtual environment using python -m pip install -U pip and pip install --upgrade pip but it is hanged without producing any output here is the screenshot.

I try pip install pyopenssl:

(bookmarks) bookmarks> pip install pyopenssl
Collecting pyopenssl
  Using cached https://files.pythonhosted.org/packages/b2/5e/06351ede29fd4899782ad335c2e02f1f862a887c20a3541f17c3fa1a3525/pyOpenSSL-20.0.1-py2.py3-none-any.whl
Collecting six>=1.5.2 (from pyopenssl)
  Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting cryptography>=3.2 (from pyopenssl)
  Using cached https://files.pythonhosted.org/packages/cc/98/8a258ab4787e6f835d350639792527d2eb7946ff9fc0caca9c3f4cf5dcfe/cryptography-3.4.8.tar.gz
  Installing build dependencies ...

it hangs on Installing build dependencies .... I've waited 30mins but nothing happened.

I've also tried python -m pip install pyopenssl

(bookmarks) bookmarks> python -m pip install pyopenssl
Collecting pyopenssl
  Using cached https://files.pythonhosted.org/packages/b2/5e/06351ede29fd4899782ad335c2e02f1f862a887c20a3541f17c3fa1a3525/pyOpenSSL-20.0.1-py2.py3-none-any.whl
Collecting cryptography>=3.2 (from pyopenssl)
  Using cached https://files.pythonhosted.org/packages/cc/98/8a258ab4787e6f835d350639792527d2eb7946ff9fc0caca9c3f4cf5dcfe/cryptography-3.4.8.tar.gz
  Installing build dependencies ... \

And when I try pip -v install pyopenssl: (Since the ouput is large, i'm only showing the last part.)

    Added semantic-version>=2.6.0 from https://files.pythonhosted.org/packages/a5/15/00ef3b7888a10363b7c402350eda3acf395ff05bebae312d1296e528516a/semantic_version-2.8.5-py2.py3-none-any.whl#sha256=45e4b32ee9d6d70ba5f440ec8cc5221074c7f4b0e8918bdab748cc37912440a9 (from setuptools-rust>=0.11.4) to build tracker 'C:\\Users\\Suhail\\AppData\\Local\\Temp\\pip-req-tracker-86fcyvxc'
    Removed semantic-version>=2.6.0 from https://files.pythonhosted.org/packages/a5/15/00ef3b7888a10363b7c402350eda3acf395ff05bebae312d1296e528516a/semantic_version-2.8.5-py2.py3-none-any.whl#sha256=45e4b32ee9d6d70ba5f440ec8cc5221074c7f4b0e8918bdab748cc37912440a9 (from setuptools-rust>=0.11.4) from build tracker 'C:\\Users\\Suhail\\AppData\\Local\\Temp\\pip-req-tracker-86fcyvxc'
  Installing collected packages: setuptools, wheel, pycparser, cffi, toml, semantic-version, setuptools-rust

    Creating C:\Users\Suhail\AppData\Local\Temp\pip-build-env-fwbrqqmx\overlay\Scripts

  Successfully installed cffi-1.14.6 pycparser-2.20 semantic-version-2.8.5 setuptools-58.1.0 setuptools-rust-0.12.1 toml-0.10.2 wheel-0.37.0
  Cleaning up...
  Cleaned build tracker 'C:\\Users\\Suhail\\AppData\\Local\\Temp\\pip-req-tracker-86fcyvxc'
  1 location(s) to search for versions of pip:
  * https://pypi.org/simple/pip/
  Getting page https://pypi.org/simple/pip/
  Found index url https://pypi.org/simple
  Looking up "https://pypi.org/simple/pip/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 304 0

Here again i'm stuck at this output, and pyOpenSSL is not installed.

However, pip install pyopenssl worked outside of the virtual environment screenshot

I'm stuck at this freeze for 2 days. If you know the solution then please answer it. Thankyou

like image 991
Suhail Ahmed Avatar asked Dec 18 '25 16:12

Suhail Ahmed


1 Answers

Here's what worked for me

Step 1: First I uninstalled pip:

pip uninstall pip

To make sure pip is uninstalled type pip and make sure you get ModuleNotFoundError: No module named 'pip'

Step 2: Download PIP get-pip.py:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Step 3: Install PIP:

python get-pip.py

To make sure pip is installed run pip --version make sure it is latest, (21.2.4) as of now.


Finally I was able to install pyopenssl :))

pip install pyopenssl
like image 97
Suhail Ahmed Avatar answered Dec 21 '25 05:12

Suhail Ahmed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!