Ssl module in python is not available windows

Asked

Viewed
19k times

I have Python 3.7.1 installed on Windows 7 from www.python.org.
When I want to «pip install pylab» I receive the following message:
«pip is configured with locations that require tls/ssl however the ssl module in python is not available».
Please help me to overcome this problem.
Many thanks

  • python
  • ssl

asked Nov 4, 2018 at 4:18

Andy's user avatar

AndyAndy

1011 gold badge1 silver badge3 bronze badges

5

  • What are the contents of the PATH variable? Probably it’s missing a path here.

    Nov 4, 2018 at 12:22

  • Not sure where the PATH variable should be.

    Nov 6, 2018 at 9:26

  • Open a command window and execute ‘set PATH’ (without the quotes). Post the contents.

    Nov 6, 2018 at 10:13

  • Path=C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Jav a\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Sy stem32\WindowsPowerShell\v1.0\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

    Nov 6, 2018 at 10:24

  • I had the same problem installing Annaconda 3.7.1 on Windows 10, and had selected the «Add to Path» option during installation. @Bhaargavi Agrawal’s solution below worked for me.

    Apr 7, 2019 at 13:55

5 Answers

According to your comment with the PATH variable you are missing the right entries to this so it cannot find the libraries and so on.

If you reinstall python in the first screen you have an option ‘Add Python x.x.x to PATH’ enable this option and then retry what you did.

answered Nov 6, 2018 at 14:52

rfkortekaas's user avatar

rfkortekaasrfkortekaas

6,0592 gold badges27 silver badges34 bronze badges

2

  • One more question if you don’t mind. Now when I «pip install pylab» then I got the red message: «could not find a version that satisfies the requirement pylab (from versions:) No matching distribution found for pylab». Do I have to install matplotlib first or is there any other way to get pylab? Many thanks

    Nov 7, 2018 at 3:27

  • Why are you trying to use pylab? It was part of Matplotlib but is deprecated for some time already.

    Nov 10, 2018 at 18:23

I also had the same problem. But solved it by just adding path variables in evt variables
So check for the following paths
1. Anaconda root
2. Anaconda/Scripts
3. Anaconda/Library/bin
the 3rd one was not added and after adding all these evt variables do restart your PC. and the error will be resolved.

answered Feb 28, 2019 at 20:13

Bhaargavi Agrawal's user avatar

What worked for me is:
conda activate in command prompt and then use pip

Danny Varod's user avatar

Danny Varod

17.4k5 gold badges69 silver badges111 bronze badges

answered May 4, 2019 at 22:56

Aayush Upadhyay's user avatar

2

  • how is it relevant ? the original post did not mention anything related to conda

    May 4, 2019 at 23:50

  • @LoneWanderer, this works! Activating conda did enable pip to work and download the missing whl file dependencies on Windows while installing the whl I needed. Usage (from condabin folder: activate.bat) then from the python.exe folder python.exe -m pip install <package>. This worked without me having to pollute my machines’ path.

    Jun 11, 2019 at 19:58

Activating conda (from condabin folder: activate.bat) and then from the python.exe folder «python.exe -m pip install siphon»

answered Aug 23, 2019 at 13:01

Manish Kumar's user avatar

I had the same issue because of corporate firewall settings.

If you are on windows go to «Internet Properties» —> «Connection» —> «LAN Settings» and check the address (if it is a wpad.dat file, download it and look for «ProxyPort» and «ProxyServer»).

Then try :

pip —proxy http://user:password@ProxyServer:ProxyPort install module

answered Oct 2, 2019 at 13:47

Caterina De Franco's user avatar

  • The Overflow Blog
  • Featured on Meta

Linked

Related

Hot Network Questions

  • Fungus gnats or thrips?

  • Idiom for unexpected solution?

  • Why is a stray semicolon no longer detected by `-pedantic` modern compilers?

  • Why is the central truss segment of the ISS called S0?

  • In the Spanish-American War (1898), who formally declared war first?

  • Homebrew retractable shield

  • Understanding TLS Protections Against DNS Spoofing and Fake Websites

  • What could happen if my university loses its R2 status?

  • When did “word” become a synonym of “promise” for the first time?

  • Better proof for a proposition when a proof is already available

  • How to identify transcendental numbers?

  • How can I seal a crack in a teapot in a foodsafe manner?

  • A 70s short story about fears made real

  • he used to smoke with me

  • Beacon contract contructor seems to call address 0x02?

  • Can a defense attorney face any serious repercussions for trying to nullify the jury?

  • How can unrelated language families exist?

  • How to draw the trajectory of the circumscribed rectangle of an ellipse and determine the area range of the rectangle?

  • Is the Clebsch-Gordan decomposition of Lie algebra or Lie group representations?

  • If there is still space available in the overhead bin after boarding and my ticket has an under-seat carry-on only, can I put my bag up there?

  • Sum the inverse of the successor of the square of the natural numbers

  • Can a social sciences doctoral thesis be just 65k words long?

  • How can I write the equation of the parabola passing through list of three points?

  • How can I make onboard PC speaker beep on Ubuntu Server 22.04.3 LTS?

more hot questions

Question feed

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Asked

Viewed
19k times

I have Python 3.7.1 installed on Windows 7 from www.python.org.
When I want to «pip install pylab» I receive the following message:
«pip is configured with locations that require tls/ssl however the ssl module in python is not available».
Please help me to overcome this problem.
Many thanks

  • python
  • ssl

asked Nov 4, 2018 at 4:18

Andy's user avatar

AndyAndy

1011 gold badge1 silver badge3 bronze badges

5

  • What are the contents of the PATH variable? Probably it’s missing a path here.

    Nov 4, 2018 at 12:22

  • Not sure where the PATH variable should be.

    Nov 6, 2018 at 9:26

  • Open a command window and execute ‘set PATH’ (without the quotes). Post the contents.

    Nov 6, 2018 at 10:13

  • Path=C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Jav a\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Sy stem32\WindowsPowerShell\v1.0\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

    Nov 6, 2018 at 10:24

  • I had the same problem installing Annaconda 3.7.1 on Windows 10, and had selected the «Add to Path» option during installation. @Bhaargavi Agrawal’s solution below worked for me.

    Apr 7, 2019 at 13:55

5 Answers

According to your comment with the PATH variable you are missing the right entries to this so it cannot find the libraries and so on.

If you reinstall python in the first screen you have an option ‘Add Python x.x.x to PATH’ enable this option and then retry what you did.

answered Nov 6, 2018 at 14:52

rfkortekaas's user avatar

rfkortekaasrfkortekaas

6,0592 gold badges27 silver badges34 bronze badges

2

  • One more question if you don’t mind. Now when I «pip install pylab» then I got the red message: «could not find a version that satisfies the requirement pylab (from versions:) No matching distribution found for pylab». Do I have to install matplotlib first or is there any other way to get pylab? Many thanks

    Nov 7, 2018 at 3:27

  • Why are you trying to use pylab? It was part of Matplotlib but is deprecated for some time already.

    Nov 10, 2018 at 18:23

I also had the same problem. But solved it by just adding path variables in evt variables
So check for the following paths
1. Anaconda root
2. Anaconda/Scripts
3. Anaconda/Library/bin
the 3rd one was not added and after adding all these evt variables do restart your PC. and the error will be resolved.

answered Feb 28, 2019 at 20:13

Bhaargavi Agrawal's user avatar

What worked for me is:
conda activate in command prompt and then use pip

Danny Varod's user avatar

Danny Varod

17.4k5 gold badges69 silver badges111 bronze badges

answered May 4, 2019 at 22:56

Aayush Upadhyay's user avatar

2

  • how is it relevant ? the original post did not mention anything related to conda

    May 4, 2019 at 23:50

  • @LoneWanderer, this works! Activating conda did enable pip to work and download the missing whl file dependencies on Windows while installing the whl I needed. Usage (from condabin folder: activate.bat) then from the python.exe folder python.exe -m pip install <package>. This worked without me having to pollute my machines’ path.

    Jun 11, 2019 at 19:58

Activating conda (from condabin folder: activate.bat) and then from the python.exe folder «python.exe -m pip install siphon»

answered Aug 23, 2019 at 13:01

Manish Kumar's user avatar

I had the same issue because of corporate firewall settings.

If you are on windows go to «Internet Properties» —> «Connection» —> «LAN Settings» and check the address (if it is a wpad.dat file, download it and look for «ProxyPort» and «ProxyServer»).

Then try :

pip —proxy http://user:password@ProxyServer:ProxyPort install module

answered Oct 2, 2019 at 13:47

Caterina De Franco's user avatar

  • The Overflow Blog
  • Featured on Meta

Linked

Related

Hot Network Questions

  • Why would employee be paid less than contractor?

  • Sum the inverse of the successor of the square of the natural numbers

  • Closest in meaning to «It isn’t necessary for you to complete this by Tuesday.» — is the question’s answer wrong?

  • Beacon contract contructor seems to call address 0x02?

  • What makes some players so good?

  • Calculate NDos-size of given integer

  • Story ID: Lafferty? Conversation about a condensing/telescoping past

  • Is the Clebsch-Gordan decomposition of Lie algebra or Lie group representations?

  • How to plot railway tracks?

  • Idiom for unexpected solution?

  • Copy contents of one file to another using sed

  • How can I make onboard PC speaker beep on Ubuntu Server 22.04.3 LTS?

  • Who coined the term «signal-to-noise ratio» and when did statisticians start using the term «noise» to describe randomness?

  • Is Emptiness empty of Dhammas?

  • In the Spanish-American War (1898), who formally declared war first?

  • Fungus gnats or thrips?

  • Understanding TLS Protections Against DNS Spoofing and Fake Websites

  • Applying for a PhD as a disabled person

  • How to take good photos of stars out of a cockpit window using the Samsung 21 ultra?

  • How can I write the equation of the parabola passing through list of three points?

  • In the UK, can residents leave their gate open taking pavement space?

  • Use of the word «грамота»

  • Random factorized numbers

  • Contradiction in negative mass interactions according to GR

more hot questions

Question feed

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

@liurui39660

python version: 3.6 (Intel Distribution for Python for Windows 2018 update 1)
virtualenv version: 15.1.0
windows version: windows 10 pro, build 17101.rs4_release.180211-1040

I executed only 2 commands, here is what Powershell output:

PS E:\Python\Virtualenv\Scripts> .\activate
(Virtualenv) PS E:\Python\Virtualenv\Scripts> pip install numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
  Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

This directory Python is not where the python installed, it is only a normal directory.

I have tried installing some standalone openssl, like the one from here, but neither of them worked.

ceefour, mstepanovic, njho, bryan-hoang, petrkrejci1, lowmountain, MartinPetrov8, cool21540125, tonnyhjw, dsaw, and 11 more reacted with thumbs up emoji

@tobiasherp

I assume the pip used is the one in your virtualenv. Is your system pip able to install? If not, this might not be a virtualenv issue …

@liurui39660

@tobiasherp
System pip is ok, but the pip in the virtualenv does no good.
I don’t know where the issue is, I can’t even find a similar situation on Google. :(
Not only the numpy, it can’t install any package online. But if there is a wheel file, it can be installed successfully, thus I think the problem might be related to the SSL.

@tobiasherp

Right, PyPI uses https now, so you need ssl support. If your system Python doesn’t have it, your virtualenv won’t have it either. With Python 3, you should be able to import an ssl module:

Your best bet might be to switch to an interpreter which has the ssl module.
The 3.6.4 interpreter I just now downloaded from https://www.python.org/ seems to have ssl support.

@tobiasherp

AFAICS, this is not a virtualenv issue; proposing to close it.

@theCJMan

It might not be a venv problem but it is still a problem. In my instance I cannot install in venv or system pip
I have IntelPython3 installed on Win 10 64 bit and YES it has openssl installed and compiled but for some reason things does not work

I have seen this: [(https://software.intel.com/en-us/forums/intel-distribution-for-python/topic/737878#comment-1920719)]

But I could not fix my version of this problem.

Any advice on this issue would be very helpfull

@brainwane

@theCJMan are you still experiencing this problem?

@theCJMan

@brainwane

Transport Layer Security, or TLS, is part of how we make sure connections between your computer and PyPI are private and secure. It’s a cryptographic protocol that’s had several versions over time.

You need to be connecting to PyPI with a TLS support library, such as a recent version of OpenSSL. The specific steps you need to take will depend on your operating system version, where your installation of Python originated (python.org, your OS vendor, or an intermediate distributor), and the installed versions of Python, setuptools, pipenv, and pip. For help, please go to the #pypa IRC channel on Freenode, file an issue at pypa/packaging-problems/issues, or post to the python-help mailing list, including your OS and installation details and the output of pip install -vvv upgrade pip.

@gbrand-salesforce

I also experienced this on macos, python 2.7.15 — system python worked fine, virtual env failed to install due to

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

my system python imported ssl fine, but the venv python gave the following error:

raceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 126, in <module>
    from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_TLSv1_3
ImportError: cannot import name HAS_TLSv1_3

after deleting the env directory, and recreating the env, it all worked fine.

@ceefour

I got same issue as @liurui39660 , also using Intel Python Distribution and python -m venv to create my venv. It seems to be an issue with ssl module, having nothing to do with pip:

(venv) C:\Users\ceefour\git\tews\ecn-svc>python
Python 3.6.3 |Anaconda custom (64-bit)| (default, May  3 2018, 23:39:44) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\lib\ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: The operating system cannot run %1.
>>>

Note that the bug only triggered when using Intel Python inside a venv. When using the base env, it works:

(base) C:\Users\ceefour>python
Python 3.6.3 |Anaconda custom (64-bit)| (default, May  3 2018, 23:39:44) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import ssl
>>> 

Update: This thread seems to be a clue:

Rohit J. (Intel) Thu, 07/06/2017 — 21:40
pip was unusable with both IDP and Miniconda on Windows. The problem was root-caused to a conflicting library (libeay32.dll) that was installed in system path. At run-time, loading of this library gained precedence over what we ship with our distribution. There was a version conflict and the execution would fail with «ImportError: DLL load failed: The operating system cannot run %1.». Removing this extraneous library from system path resolved the issue.

I have lots of libeay32.dll inside of C:\Program Files, including one in C:\ProgramData\Anaconda3\Library\bin

I have tried moving C:\ProgramData\Anaconda3\Library\bin to front of PATH, but still error happens.

@willliu1995

I had the same issue. I was configuring a new computer with python and jupyter with anaconda, and the problem occured when I tried to install a package use pip.

Based on the discussions above, that this is an environment issue, I tried running «pip install» command in Anaconda Prompt instead of cmd. And the pip command was executed. 😁

tomoemon, babakansari, hagaishalev, dotChris90, magedHelmy, huyinjie, ali-08, hooNpk, eugeneniemand, portrayalofdecay, and 85 more reacted with thumbs up emoji
kumailn, hakan458, kwaazaar, and epignatelli reacted with thumbs down emoji
hagaishalev, hooNpk, hal0taso, therickli, graf-m-96, schultzdre, JonasFockstedt, xyuebai, and FeelCoolOne reacted with laugh emoji
martinbagic and choi-b reacted with hooray emoji
Tesax123, xyuebai, choi-b, vahidzolf, pritamlad, and DanieleGravina reacted with heart emoji
ksiomelo, schultzdre, cyrilcher, njho, xyuebai, and choi-b reacted with rocket emoji

@Max2030

I am still struggling with following since yesterday, after installing Python 3.7.1 with Anaconda3

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)’: /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)’: /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)’: /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)’: /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)’: /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)) — skipping
Requirement already up-to-date: pip in d:\anaconda3\lib\site-packages (18.1)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.»)) — skipping

@PekkaSun

I had the same problem. Using willliu1995 suggestion solved the problem. Running pip from cmd prompt did nor work but launching jupyter notebook and running !pip install worked.

@manishjain84

@shriprem

If you prefer to use the Windows Command Prompt instead, you will need to add the following directories to your Windows Environment path:
%Miniconda3_DIR%;%Miniconda3_DIR%\Library\mingw-w64\bin;%Miniconda3_DIR%\Library\usr\bin;%Miniconda3_DIR%\Library\bin;%Miniconda3_DIR%\Scripts;%Miniconda3_DIR%\bin;
[where, %Miniconda3_DIR% should be substituted by your Miniconda (or Anaconda) install path]

For example, I have my Miniconda installed at E:\Portable\Miniconda3. So my Windows PATH had to include these folders:
E:\Portable\Miniconda3;E:\Portable\Miniconda3\Library\mingw-w64\bin;E:\Portable\Miniconda3\Library\usr\bin;E:\Portable\Miniconda3\Library\bin;E:\Portable\Miniconda3\Scripts;E:\Portable\Miniconda3\bin;

stefsmeets, EthanBackToLife, hukv1990, evanslight, dantravers, chris-vecchio, quqqo, itrew, shohei918, machinelearner452, and 22 more reacted with thumbs up emoji
wmxl reacted with laugh emoji
wmxl reacted with hooray emoji
wmxl, kelvionald, rivaslive, Vaunorage, and litvinich reacted with heart emoji

@EthanBackToLife

@shriprem Thanks! It worked. Your solution confirms that this is a system path issue, since generally it’s only necessary to add %Miniconda3_DIR%\Scripts to your PATH variable to use pip. Any idea why this has changed?

@shriprem

@EthanBackToLife I checked the PATH environment variable in the Anaconda prompt, and found that Anaconda was prefixing all those directories to its prompt PATH variable. So I appended the delta part of that path to the Windows PATH variable to confirm that it worked for pip.

While trying to install Conda on a different PC, I am able to refine the path changes to a much shorter: %Miniconda3_DIR%;%Miniconda3_DIR%\Scripts;%Miniconda3_DIR%\Library\bin
[On hindsight, we see that the other directories that were added to the path from my previous post are non-existent/empty on a fresh Conda install.]

With this narrowing down of the path, we can look at the %Miniconda3_DIR%\Library\bin folder. In here, we find files such as: libcrypto-1_1-x64.dll, libcrypto-1_1-x64.pdb, libssl-1_1-x64.dll, openssl.exe, libssl-1_1-x64.pdb, openssl.pdb which I think are critical in resolving the SSL/TLS issues with the pip (and conda) package installs.

evanslight, EthanBackToLife, GreKro, GabrielAsqui, mhelleis, drajput, amspector100, kthy, and jjisnow reacted with thumbs up emoji
GabrielAsqui, mhelleis, dsaw, and amspector100 reacted with hooray emoji

yocifico

added a commit
to yocifico/PSCondaEnvs
that referenced
this issue

Jan 22, 2019

@yocifico

Can't install any package via `pip` on windows 10, ssl module in Python is not available
pypa/virtualenv#1139

@dustlemon

python version: 3.6 (Intel Distribution for Python for Windows 2018 update 1)
virtualenv version: 15.1.0
windows version: windows 10 pro, build 17101.rs4_release.180211-1040

I executed only 2 commands, here is what Powershell output:

PS E:\Python\Virtualenv\Scripts> .\activate
(Virtualenv) PS E:\Python\Virtualenv\Scripts> pip install numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
  Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

This directory Python is not where the python installed, it is only a normal directory.

I have tried installing some standalone openssl, like the one from here, but neither of them worked.

I met the same question as you,and I tried to use the command .\activate ,then settled the question perfectly,I couldn’t thank you anymore.

@EthanBackToLife

@EthanBackToLife I checked the PATH environment variable in the Anaconda prompt, and found that Anaconda was prefixing all those directories to its prompt PATH variable. So I appended the delta part of that path to the Windows PATH variable to confirm that it worked for pip.

While trying to install Conda on a different PC, I am able to refine the path changes to a much shorter: %Miniconda3_DIR%;%Miniconda3_DIR%\Scripts;%Miniconda3_DIR%\Library\bin
[On hindsight, we see that the other directories that were added to the path from my previous post are non-existent/empty on a fresh Conda install.]

With this narrowing down of the path, we can look at the %Miniconda3_DIR%\Library\bin folder. In here, we find files such as: libcrypto-1_1-x64.dll, libcrypto-1_1-x64.pdb, libssl-1_1-x64.dll, openssl.exe, libssl-1_1-x64.pdb, openssl.pdb which I think are critical in resolving the SSL/TLS issues with the pip (and conda) package installs.

Great explanation! Thank you.

@SnarkyPapi

I still have this problem after doing what @shriprem commented. Python version 3.7.1 and pip version 18.1, if that helps.

@joyenjoye

@PhilipDeegan

I’ve found being in the «Scripts» directory is required to use pip

@wmxl

For Windows 10 If pip install is not working on CMD prompt, run it using Anaconda prompt — it works.

If you want use pip in normal CMD, not only in Anaconda prompt.
you need add 3 environment paths.
like these:
D:\Anaconda3;
D:\Anaconda3\Scripts;
D:\Anaconda3\Library\bin

most people only add D:\Anaconda3\Scripts;

wmxl, shriprem, zhaobenx, parduck, FerhatAvdic, gudlike, carloshdelreal, PrathushaKoouri, vineetmp, rogerjbos, and 16 more reacted with thumbs up emoji
dthaberlm and Rototu reacted with hooray emoji
VictorOchieng, dhuynh95, asoucase, and Rototu reacted with heart emoji
VictorOchieng, dhuynh95, and Rototu reacted with rocket emoji
VictorOchieng reacted with eyes emoji

@akshayshende129

Specify path C:\Anaconda3\Library\bin in environment user variables.
Or
Just check wheather you have openssl installed in base python
If not just install using following command
pip install pyopenssl

@SnarkyPapi

I believe the paths are added correctly, but pip is still not working, either on CMD or on Anaconda prompt.

@PhilipDeegan

did you try from the «Scripts» directory?

@SnarkyPapi

did you try from the «Scripts» directory?

If you mean cd xxx/Scripts and then pip install, I tried just now and it’s not working.

@SnarkyPapi

Alternative solution: I just managed to make it work by creating a pip.ini file under C:\Users\my_user_name\pip, writing:

[global]
index-url=http://pypi.douban.com/simple/
[install]
trusted-host=pypi.douban.com

It solves the problem for the moment, however the download speed using this mirror is not really fast (around 800kb/s). Is there a way to make it work as usual?

@SnarkyPapi

can you echo %PATH%

you might have open a new terminal for the PATH to change

C:\Anaconda\Library\bin;D:\Software\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;D:\Software\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Razer Chroma SDK\bin;D:\Software\Razer Chroma SDK\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Software\PuTTY;C:\windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;D:\Software\dotnet;D:\Software\MySQL\MySQL Utilities 1.6;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;D:\Software\Git\cmd;C:\Users\Cyril\pip\pip.ini;C:\Anaconda;C:\Anaconda\Library\mingw-w64\bin;C:\Anaconda\Library\usr\bin;C:\Anaconda\Scripts;C:\Anaconda\bin;C:\Anaconda\Library\bin;C:\Anaconda;C:\Anaconda\Library\mingw-w64\bin;C:\Anaconda\Library\usr\bin;C:\Anaconda\Scripts;C:\Anaconda\bin;D:\Software\Docker Toolbox;C:\Users\Cyril\pip\pip.ini;

@datatravelgit

SSL libraries are in your C:\anaconda\Library\bin folder. You have to have that path set at the moment of trying to install your libraries. This is because, when you activate a virtual environment, the PATH is changed.

Therefore,

  • If you do not use virtual environments, manually set the PATH to:
set PATH=C:\anaconda;C:\anaconda\Scripts;C:\anaconda\Library\bin
pip  install any_library
or
pip install -r requirements.txt

  • If you do use virtual environments, manually set the PATH to:
set PATH=C:\venvs\ve1\;C:\venvs\ve1\Scripts;C:\anaconda\Library\bin
pip  install any_library
or
pip install -r requirements.txt

Note that C:\anaconda\Library\bin is consistent in both cases, regardless if you are working in a vm or not.

@SnarkyPapi

@datatravelgit Hi, I am not using virtual environments and there is still this problem after setting path manually.

@vineetmp

Thanks for the helpful comments above! Adding the following to the path variable worked for me on Windows 10:
C:\Users…\Anaconda3
C:\Users…\Anaconda3\Scripts
C:\Users…\Anaconda3\Library\bin

@yilingsj

I got same issue as @liurui39660 , also using Intel Python Distribution and python -m venv to create my venv. It seems to be an issue with ssl module, having nothing to do with pip:

(venv) C:\Users\ceefour\git\tews\ecn-svc>python
Python 3.6.3 |Anaconda custom (64-bit)| (default, May  3 2018, 23:39:44) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\lib\ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: The operating system cannot run %1.
>>>

Note that the bug only triggered when using Intel Python inside a venv. When using the base env, it works:

(base) C:\Users\ceefour>python
Python 3.6.3 |Anaconda custom (64-bit)| (default, May  3 2018, 23:39:44) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import ssl
>>> 

Update: This thread seems to be a clue:

Rohit J. (Intel) Thu, 07/06/2017 — 21:40
pip was unusable with both IDP and Miniconda on Windows. The problem was root-caused to a conflicting library (libeay32.dll) that was installed in system path. At run-time, loading of this library gained precedence over what we ship with our distribution. There was a version conflict and the execution would fail with «ImportError: DLL load failed: The operating system cannot run %1.». Removing this extraneous library from system path resolved the issue.

I have lots of libeay32.dll inside of C:\Program Files, including one in C:\ProgramData\Anaconda3\Library\bin

I have tried moving C:\ProgramData\Anaconda3\Library\bin to front of PATH, but still error happens.
————-更新:20190327
刚qq来了个邮件,点进来才发现是这个问题,这个后来解决了。我在电脑上重新安装了Win64OpenSSL_Light-1_1_1b.exe ,然后anaconda卸载并重装。现在anaconda和python都正常了。

————-以下为旧内容
谢谢,我昨天也遇到了相同的问题,然后我把Anaconda卸载后重装了,但并没有解决。刚才我从单独的目录中执行import ssl,anaconda中的报错,另外一个不报错。如图:
GitHub Logo
我把pycharm中的路径修改后,pycharm也可以正常运行了。

@jankap

I had to replace the libssl-1_1-x64.dll in my envs/myenv/Library/bin folder with the base env dll. It was not the same one. Plus I had another libssl-1_1-x64.dll under C:/Windows/System32/ and under certain Intel folders in C:/Program Files. I removed the Intel stuff from the path and deleted the one under system32.

Not sure when the corrupt dll has been copied, but replacing it with the one from conda/Library/bin/ worked well.

To further check errors, you could activate your environment and type python -c "import ssl". It’s an important difference, if the error is «Module not found» (-> dll cannot be found at all, might be a Path problem) or «Procedure entry point not found» (-> likely, a corrupt/wrong dll is found).

This was referenced

Mar 28, 2019

@omerti

I had to replace the libssl-1_1-x64.dll in my envs/myenv/Library/bin folder with the base env dll. It was not the same one. Plus I had another libssl-1_1-x64.dll under C:/Windows/System32/ and under certain Intel folders in C:/Program Files. I removed the Intel stuff from the path and deleted the one under system32.

Not sure when the corrupt dll has been copied, but replacing it with the one from conda/Library/bin/ worked well.

To further check errors, you could activate your environment and type python -c "import ssl". It’s an important difference, if the error is «Module not found» (-> dll cannot be found at all, might be a Path problem) or «Procedure entry point not found» (-> likely, a corrupt/wrong dll is found).

Im experiencing same issue- «The specified procedure could not be found.» — only in specifc env.
In base env «import ssl» works well.

Tried replacing env’s libssl-1_1-x64.dll with the base env’s libssl-1_1-x64.dll — but didnt help.
Could there be any other file that’s causing this?

@Nbkeatley

Fixed for me, thanks for everyone’s comments.
The issue wasn’t fixed by adding \Anaconda3\Library\bin to the path, or even the top of the path. The same is true for \Anaconda3\Scripts and \Anaconda3\Library\mingw-w64\bin.

Tried replacing env’s libssl-1_1-x64.dll with the base env’s libssl-1_1-x64.dll — but didnt help.
Could there be any other file that’s causing this?

Removing both libssl-1_1-x64.dll and libcrypto-1_1-x64.dll in C:/Windows/System32/ fixed the problem for me.

@ghost

I love you buddy!
Removing both libssl-1_1-x64.dll and libcrypto-1_1-x64.dll in C:/Windows/System32/ fixed the problem for me.

@autodataming

@beaumsc

@pranitverma

this problem can be solved by changing the path through this pc
go to properties
then go to advance settings
then environment variables
then system variables
then path
double click path
check the path of installed python
if you have anaconda
then delete both paths and
then click new
then copy the path of python 3.7 or latest python til scripts i.e
(C:\Users’user name’\AppData\Local\Programs\Python\Python37\scripts)
then click ok
next also click new
then copy the path C:\Users’user name’\AppData\Local\Programs\Python\Python37
then restart the cmd as admin and retry installation

@chudnovs

Funny thing: I had the same problem on Android, Termux. Pip could not connect to pypi.org due to absent ssl.
The problem is clearly with ssl module. So, initially check, if you have any ssl installed. If yes, upgrade it to the latest versions, as ssl algorithms evolve quickly, and become incompatible.
Try either to update existing library, or install a better supported package.

@msarahan

@shriprem

I had a recurrence of the SSL issue with pip module installs. Before this, pip had worked fine for several months — after correctly configuring the environment path to include the 3 conda folders: %Conda_DIR%;%Conda_DIR%\Scripts;%Conda_DIR%\Library\bin.

After a couple of hours of wrangling, I arrived at these two solutions — one for module installs via pip, and the other for those via conda.

Module installs via pip

Basically, based on the error messages, I had to add pypi.org and files.pythonhosted.org sites as trusted hosts.

You could do this once via: pip config set global.trusted_host "pypi.org files.pythonhosted.org"
This setting change is saved in C:\Users\user_name\Appdata\Roaming\pip\pip.ini (in short, %APPDATA%\pip\pip.ini) file. Since this is in a non-administrator user folder from the Windows perspective, it should be safe to do so.

[If you are not comfortable with the ‘global’ setting change, you could repeat this during every module install.
For example: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -U matplotlib]

Module installs via conda

Some Python modules like basemap don’t install via pip. I had to use conda instead.
To override the SSL error with conda, I had to use: conda config --set ssl_verify false

[After the conda module install, I turned the ssl back on with: conda config --set ssl_verify true]

While resolving these issues today, the general info at https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#ssl-connection-errors and the specific sites info from the install-time error messages — both proved helpful.

@jmhcodes

Hi when in the anaconda prompt i am unable to use pip due to TSL/SSL issues:

(base) C:\Users\joshu>pip install pandahouse
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

But i am able to pip install anything I want when using python native:

C:\Users\joshu\AppData\Local\Programs\Python\Python37\Scripts>pip install scrapy
Collecting scrapy
  Downloading http....

What I’ve done so far:

  1. Installed Python first
  2. Installed anaconda
  3. Reinstalled anaconda
  4. Removed libcrypto-1_1-x64.dll and libssl-1_1-x64.dll from System32/
  5. Added my Anaconda libraries to the top system and user variables of PATH
    C:\Users\joshu\Anaconda3\Library\bin
  6. Still does not work

CMD Prompt Locations in native Python:

C:\Users\joshu\AppData\Local\Programs\Python\Python37\Scripts>where libssl-1_1-x64.dll
C:\Users\joshu\Anaconda3\Library\bin\libssl-1_1-x64.dll

C:\Users\joshu\AppData\Local\Programs\Python\Python37\Scripts>where libcrypto-1_1-x64.dll
C:\Users\joshu\Anaconda3\Library\bin\libcrypto-1_1-x64.dll

Anaconda Prompt locations:

(base) C:\Users\joshu>where libssl-1_1-x64.dll
C:\Users\joshu\Anaconda3\Library\bin\libssl-1_1-x64.dll

(base) C:\Users\joshu>where libcrypto-1_1-x64.dll
C:\Users\joshu\Anaconda3\Library\bin\libcrypto-1_1-x64.dll

Not sure if this matters but OPENSSL_CONF C:\OpenSSL-Win64\bin\openssl.cfg appears above PATH in my system variables.

Could someone please help I am not sure how to solve this and would really prefer using Anaconda/Spyder instead of native python

@shriprem

@jmhcodes, check out this link: https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3

Also on stackoverflow, I came across another discussion that was more relevant to the sudden recurrence of the SSL certificate verify error that I started facing on my work PC. The discussion link is: https://stackoverflow.com/questions/25981703/pip-install-fails-with-connection-error-ssl-certificate-verify-failed-certi

In a couple of those answers, there were these statements:

In my case, the certificates in my company’s network was the issue.

and

I recently ran into this problem because of my company’s web content filter that uses its own Certificate Authority so that it can filter SSL traffic.

So in my case, it was the corporate network firewall that broke my pip. But adding files.pythonhosted.org & **pypi.org as trusted hosts has resolved the issue for now.

Honestly, I hadn’t seen the 2nd stackoverflow discussion when I had resolved the issue last week, and posted my solution steps here. A majority of responses in the stackoverflow article agree that using --trusted-host solved their pip issues as well. In addition to the two sites mentioned above, they also recommend adding pypi.python.org

@jmhcodes

@shriprem

@jmhcodes, run the command where pip.exe within both the regular command prompt and the Anaconda prompt. Do they both return the same path to pip.exe?

Here are some of the differences that the Anaconda prompt brings to its environment over the regular command prompt:

  1. Anaconda prefixes 7 of its subdirectories at the very front of the regular environment path. You can check this by running the command echo %path% from within both environments and diffing them. Those 7 subdirectories are:
    %CONDA_DIR%; %CONDA_DIR%\Library\mingw-w64\bin; %CONDA_DIR%\Library\usr\bin; %CONDA_DIR%\Library\bin; %CONDA_DIR%\Scripts; %CONDA_DIR%\bin; %CONDA_DIR%\condabin;

Note: %CONDA_DIR% should be substituted with your Anaconda install path.

  1. Anaconda also defines these new environment variables:
    CONDA_DEFAULT_ENV, CONDA_EXE, CONDA_PREFIX, CONDA_PROMPT_MODIFIER, CONDA_PYTHON_EXE, CONDA_SHLVL, PYTHONIOENCODING, PROJ_LIB, _CONDA_SET_PROJ_LIB
    You can verify this by running the command set from both environments and diffing them.

These differences between the two environments could be causing whatever issues you are having. It is up to you to dig further.

But if pip.exe is pointing to the same binary from both environments, you shouldn’t be very much concerned about which environment you are using to run pip. Also, I wouldn’t be too concerned about adding the very well known python.org pip sites as trusted hosts. So were many at stackoverflow. That’s my two cents.

Lastly, you mentioned:

Not sure if this matters but OPENSSL_CONF C:\OpenSSL-Win64\bin\openssl.cfg appears above PATH in my system variables.

That’s because the system variable OPENSSL_CONF comes before PATH when being listed in the alphabetical order. So it shouldn’t matter for the issue you are having. Or did I misinterpret what you were saying?

@jmhcodes

Anaconda Promt
pip 19.1.1 from C:\ProgramData\Anaconda3\lib\site-packages\pip (python 3.7)

Cmd prompt
C:\Users\joshu\AppData\Local\Programs\Python\Python37\Scripts\pip.exe

But i cant even open spyder/anaconda nav or anything else related to the anaconda suite other than anaconda prompt:

(base) C:\Users\joshu>spyder.exe
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\github.py", line 51, in <module>
    from urllib2 import build_opener, HTTPSHandler, Request, HTTPError
ModuleNotFoundError: No module named 'urllib2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3285, in main
    mainwindow = run_spyder(app, options, args)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3140, in run_spyder
    main.setup()
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 809, in setup
    from spyder.plugins.console import Console
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\console.py", line 37, in <module>
    from spyder.widgets.reporterror import SpyderErrorDialog
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\reporterror.py", line 26, in <module>
    from spyder.widgets.github.backend import GithubBackend
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\github\backend.py", line 33, in <module>
    from spyder.utils.external import github
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\github.py", line 58, in <module>
    from urllib.request import build_opener, HTTPSHandler, HTTPError, Request
ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (C:\ProgramData\Anaconda3\lib\urllib\request.py)

@cristiannietodev91

I work with visual studio Code and I had the same problem it was because doesn’t was active conda virtual env I executed that

imagen

@pypa
pypa

locked as off-topic and limited conversation to collaborators

Sep 20, 2019

If you are using the pip command to install the SSL module and get an error, don’t worry; we’ve got you covered. This blog will provide everything you will require to fix this error. We will discuss the SSL module in PPython, so let’s get started.

This module is used to create secure sockets layer (SSL) connections. It allows you to handle SSL certificate verification and self-signed certificates. SSL module in Python is a library that helps you create your own SSL server and client using Python. It allows you to easily create your own HTTPS server with the help of Python. One can encrypt data before its transmission over a network (e.g., HTTP) or by storing it in a database (e.g., SQLite). It supports critical exchange algorithms such as Diffie-Hellman and ECDHE.

The Python SSL library makes creating a secure connection between two applications accessible by providing an easy-to-use API that supports multiple encryption algorithms and provides access to various types of certificates (X509v3, PKIX, and OpenPGP).

The SSL module in Python is not available by default. It can be installed using pip or easy_install.

Why is the SSL module not available in Python?

This happens when some libraries are missed out during installation. To solve this, you can re-install all libraries.

Resolution of Error

Update pip. Make sure you have the current upgraded version of this command.

pip3 install --upgrade pip

Some necessary libraries include:

  •  libffi-dev
  • libssl-dev
  • libbz2dev

All these need to be downloaded on your system.

SSL module for ubuntu

Install the necessary libraries on ubuntu too.

sudo apt install libbz2-dev libffi-dev libssl-dev

Later, install the latest version of Python and extract the python file. Next, open the terminal and cd into the Python directory. Now, configure all files using $ ./configure command in terminal. You need to put together all files using

$ make && sudo make install

Lastly, you have to install the required packages with this command:

$ pip3 install [pname]
#here, pname refers to package name

How to fix this issue on Windows

Go to https://pypi.python.org/simple/requests and install the recent version. Unzip it and then install it in another folder. Next, just run the given command and you’re good to go.

pip install c:\temp\requests-2.21.0

Why SPIdev for Windows is a Game-Changer: Everything You Need to Know

How to fix this issue on Red Hat/CentOS

In case you are using CentOS, first you have to enter the first command on the terminal. This will ensure download of ssl module. Next, you need to work on recently installed zip version of Python. Just configure and rest of the steps are same.

sudo yum -y install bzip2-devel libffi-devel openssl-devel
wget https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tgz

How to fix this issue on Mac

There’s an easy way out for Mac users. In case you have encountered an error related to the unavailability of the ssl module, it might be because the operating systen on Mac has changed the setup to LibreSSL. Therefore, downloading a zip file from https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip will help the user in fixing the ‘SSL module in python is not available’ error.

How to fix this issue on Termux

In case you obtain the error while working on Termux, you should know that just updating the packages will also help. Upgrade them to the most recent versions and then you won’t get the error anymore for absence of ssl module.

apt update && apt full-upgrade

How to fix this issue on Raspberry Pi

Make sure that all necessary packages ars installed. Use the given statements to do the same. Install and re-install Python with the latest version also.

sudo apt-get install build-essential checkinstall 
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

How to fix this issue on Pycharm

In place of creating a virtual environment, try working with conda or a new interpreter. Also, install the latest version of ssl on your system. When the upgraded version isn’t installed, it gives an error.

Resolving the error on Anaconda

You may get this error on Anaconda when the module is installed in another folder. Say, it might be in the bin folder. So, you need to copy the given files in D:\Anaconda3\DLLs folder. Then only you can fix the given error.

libcrypto-1_1-x64.*
libssl-1_1-x64.*

Alternative to SSL module

If SSL module in Python is not available and you can use the HTTP module instead. The HTTP module provides the same functions as the SSL module but without the SSL encryption.

The http.server() function initiates a HTTP server and returns a generator object that yields new requests as they come in. The http.request() function also initiates a HTTP request, which returns an HttpResponse object containing the server’s response to that request.

FAQs

Can I disable SSL after installation?

Yes, this can be done through Internet Options settings. Go to advanced then security and double click on the SSL version installed. This will disable it.

Is SSL included in Python?

Use the pip command to install ssl on your server.

What is the use of SSL module in Python?

The SSL module enables us to use SSL certificate and TLS security for better and safer delivery of data packets across the network.

Conclusion

This article explained how to resolve the ‘SSL module in Python is not available’ error. It requires upgrading the pip command, installing the latest Python version, and the necessary SSL libraries.

Trending Python Articles

  • Why SPIdev for Windows is a Game-Changer: Everything You Need to Know

    Why SPIdev for Windows is a Game-Changer: Everything You Need to Know

    October 2, 2023

  • Print Vs Return in Python: The Ultimate Showdown

    Print Vs Return in Python: The Ultimate Showdown

    by Namrata GulatiSeptember 24, 2023

  • Python input() Vs raw_input(): Which One to Choose?

    Python input() Vs raw_input(): Which One to Choose?

    by Namrata GulatiSeptember 24, 2023

  • Why Python Fnmatch Library is a Game-Changer for File Management

    Why Python Fnmatch Library is a Game-Changer for File Management

    by Namrata GulatiSeptember 24, 2023

Using SSL in Python, you can encrypt and authenticate network sockets, both client-side and server-side, with Transport Layer Security (often called “Secure Sockets Layer”). The module relies on the OpenSSL library.

As errors are a part of programming.

You may be dealing with installing an SSL module in python. The common error you may face is “SSL module in python is not available. Could not find a version that satisfies the requirement <package> (from versions:) OR No matching distribution was found for <package>’

This module wraps TLS/SSL into a socket that can be accessed from the Operation System (OS) (Lib/ssl.py). In cases where the SSL module is unavailable,

It’s likely that you simply don’t have the OpenSSL libraries installed, or they weren’t found by Python when it was being installed.

You can easily fix this error by installing OpenSSL libraries in your Python program.

installing the OpenSSL module in Python

 fixing SSL Module is not available in Python Error

  1. Install the necessary packages for Python and SSL: $ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
  2. Download and unzip “Python-3.6.8.tar.xz” from your home directory.
  3. Open the terminal in that directory and run: $ ./configure
  4. Build and install: $ make && sudo make install
  5. Install packages with: $ pip3 install package_name

Step-by-step Guide with images

Fixation of this issue is quite simple. But you have to make sure to follow it as it is. Let’s move forward with the steps. 

1. First, make sure that you are done with the installation of all important packages to run Python and SSL. 

To do this, run the following command

sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev.  

With this, all the essential packages will get installed. 

install ssl module in python

2. After the completion of that command, you can choose to run your desired package command to see if it can run without the error showing again. 

ssl module in python is not available Linux

If the error appears, then you will have to download ‘Python 3.6.8’. 

pip is configured with location that require TLS/SSL

3. To download ‘Python 3.6.8’ go to https://www.python.org/ftp/python/.

4. Now, select ‘Python 3.6.8’ from the list available on the website. 

5. Once you have clicked on it, you will be directed to a page containing different versions of Python 3.6.8. Select the version that has a Linux extension. 

In this case, it is Python-3.6.8.tar.xz. Click on it. 

the ssl module in python is not available windows

6. You will be asked if you want to open the file or save it. Go with the ‘save file’ option. 

download python 3.6.8.tar.xz

Your file will start downloading right away. It will be downloaded in a few seconds with a good internet connection. 

once the download complete, unrar the file

7. Now, open the folder containing the downloaded ‘Python-3.6.8.tar.xz’. 

unwrap the tar file

8. Since you can see the Python folder in the ‘Downloads’, it is time to extract it. Right-click on it and select ‘Extract here’. 

Extract the tar file

The extraction process will start immediately and will be completed in no time. 

9. Once the files in Python-3.6.8.tar.xz are extracted, you can open the extracted folder.

 sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

10. By right-clicking in the folder, you will get a list of options. Select ‘Open in Terminal’. 

The terminal tab will appear on the screen. 

11. Now, run. /configure in the terminal. 

. /configure run in terminal

12. When you are done running that command, run the command sudo make && sudo make install afterward. 

sudo make && sudo make install

13. When both of the commands have run successfully, Python 3.6.8 will get installed without any issue. 

You will see a text indicating its successful installation at the bottom. 

python installed success

14. Now, it is time for you to complete the task that was not running before due to the problem ‘SSL module not available in Python’. 

Simply, write the command for it that is pip3 install package_name, and it will start running immediately without any issue. 

pip install ssl

In this instance, we wrote the command to install protonvpn.  

By carefully following the steps we have mentioned above, you will no longer face the issue of ‘SSL module in python is not available. 

Wrap Up 

Summing it up, not knowing how to deal with the problem of SSL unavailability in python can frustrate anyone. Thus, if you are stuck in this situation, you can easily get out of it by doing the easy steps we have written for your convenience. 

We hope that you have benefited from this guide and will face no more issue now. If you have any queries, you can leave a comment and we will answer it for you. 

  • Start menu windows 10 как открыть
  • Ssleay32 dll скачать для windows 10
  • Start windows update windows 10
  • Start menu reviver для windows 7
  • Ssl сертификат для windows server 2019