9

I am trying to install OpenSSL for Python on windows using command line.

I have tried running the below command:

pip install OpenSSL

I got the following error:

  Could not find a version that satisfies the requirement openssl (from versions: )
No matching distribution found for openssl

I also tried doing it as below:

pip install pyopenssl

This succeeded but, when I try running my python script which has the below line, it shows an error:

from OpenSSL import crypto, SSL

Error:

Traceback (most recent call last):
  File "C:\Users\ajayv\AppData\Local\Programs\Python\Python36-32\Scripts\ENV\Scripts\PDB Latest 1250\Endpoints\X.509.py", line 1, in <module>
    import OpenSSL
ModuleNotFoundError: No module named 'OpenSSL'

Am I missing something? Please let me know.

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
prudhvi
  • 1,141
  • 6
  • 23
  • 46
  • I just installed it and it works, do you have two versions of python installed? – Omar Einea Feb 10 '18 at 11:45
  • I used to have them....long back. But now, I have only Python 3.6 – prudhvi Feb 10 '18 at 11:50
  • 3
    Have you checked `PYTHONPATH`? – handle Feb 10 '18 at 12:20
  • 1
    also check pip, maybe you need to use pip3 instead of pip – Matt. Stroh Feb 10 '18 at 12:25
  • Possible duplicate of [ImportError after successful pip installation](https://stackoverflow.com/questions/32680081/importerror-after-successful-pip-installation) – Mark Amery Jan 19 '19 at 15:53
  • Installing `pyopenssl` with `pip` should indeed allow you to `import OpenSSL`. You almost certainly have multiple Python versions (and pip versions) installed. The answer at https://stackoverflow.com/q/32680081/1709587 describes this problem and how to fix it. The specific detail that the library you're trying to install is `pyopenssl` ultimately isn't relevant here. – Mark Amery Jan 19 '19 at 15:54
  • Potentially more relevant result for people arriving here from Google, specifically about installing `pyopenssl`: https://stackoverflow.com/q/42637878/1709587 – Mark Amery Jan 19 '19 at 15:55

0 Answers0