Ssl module in python is not available windows

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 th...

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

asked Nov 4, 2018 at 4:18

Andy's user avatar

5

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

5,8492 gold badges28 silver badges34 bronze badges

2

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

17k5 gold badges71 silver badges110 bronze badges

answered May 4, 2019 at 22:56

Aayush Upadhyay's user avatar

2

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

@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:PythonVirtualenvScripts> .activate
(Virtualenv) PS E:PythonVirtualenvScripts> 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:Usersceefourgittewsecn-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:ProgramDataAnaconda3libssl.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:Usersceefour>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:ProgramDataAnaconda3Librarybin

I have tried moving C:ProgramDataAnaconda3Librarybin 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:anaconda3libsite-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%Librarymingw-w64bin;%Miniconda3_DIR%Libraryusrbin;%Miniconda3_DIR%Librarybin;%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:PortableMiniconda3. So my Windows PATH had to include these folders:
E:PortableMiniconda3;E:PortableMiniconda3Librarymingw-w64bin;E:PortableMiniconda3Libraryusrbin;E:PortableMiniconda3Librarybin;E:PortableMiniconda3Scripts;E:PortableMiniconda3bin;

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%Librarybin
[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%Librarybin 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:PythonVirtualenvScripts> .activate
(Virtualenv) PS E:PythonVirtualenvScripts> 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%Librarybin
[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%Librarybin 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:Anaconda3Scripts;
D:Anaconda3Librarybin

most people only add D:Anaconda3Scripts;

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:Anaconda3Librarybin 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:Usersmy_user_namepip, 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:AnacondaLibrarybin;D:SoftwareNVIDIA GPU Computing ToolkitCUDAv10.0bin;D:SoftwareNVIDIA GPU Computing ToolkitCUDAv10.0libnvvp;C:Program Files (x86)Common FilesOracleJavajavapath;C:Program Files (x86)Razer Chroma SDKbin;D:SoftwareRazer Chroma SDKbin;C:windowssystem32;C:windows;C:windowsSystem32Wbem;C:windowsSystem32WindowsPowerShellv1.0;C:windowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;D:SoftwarePuTTY;C:windowssystem32configsystemprofileAppDataLocalMicrosoftWindowsApps;D:Softwaredotnet;D:SoftwareMySQLMySQL Utilities 1.6;C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;D:SoftwareGitcmd;C:UsersCyrilpippip.ini;C:Anaconda;C:AnacondaLibrarymingw-w64bin;C:AnacondaLibraryusrbin;C:AnacondaScripts;C:Anacondabin;C:AnacondaLibrarybin;C:Anaconda;C:AnacondaLibrarymingw-w64bin;C:AnacondaLibraryusrbin;C:AnacondaScripts;C:Anacondabin;D:SoftwareDocker Toolbox;C:UsersCyrilpippip.ini;

@datatravelgit

SSL libraries are in your C:anacondaLibrarybin 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:anacondaScripts;C:anacondaLibrarybin
pip  install any_library
or
pip install -r requirements.txt

  • If you do use virtual environments, manually set the PATH to:
set PATH=C:venvsve1;C:venvsve1Scripts;C:anacondaLibrarybin
pip  install any_library
or
pip install -r requirements.txt

Note that C:anacondaLibrarybin 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…Anaconda3Scripts
C:Users…Anaconda3Librarybin

@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:Usersceefourgittewsecn-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:ProgramDataAnaconda3libssl.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:Usersceefour>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:ProgramDataAnaconda3Librarybin

I have tried moving C:ProgramDataAnaconda3Librarybin 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 Anaconda3Librarybin to the path, or even the top of the path. The same is true for Anaconda3Scripts and Anaconda3Librarymingw-w64bin.

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’AppDataLocalProgramsPythonPython37scripts)
then click ok
next also click new
then copy the path C:Users’user name’AppDataLocalProgramsPythonPython37
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%Librarybin.

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:Usersuser_nameAppdataRoamingpippip.ini (in short, %APPDATA%pippip.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:Usersjoshu>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:UsersjoshuAppDataLocalProgramsPythonPython37Scripts>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:UsersjoshuAnaconda3Librarybin
  6. Still does not work

CMD Prompt Locations in native Python:

C:UsersjoshuAppDataLocalProgramsPythonPython37Scripts>where libssl-1_1-x64.dll
C:UsersjoshuAnaconda3Librarybinlibssl-1_1-x64.dll

C:UsersjoshuAppDataLocalProgramsPythonPython37Scripts>where libcrypto-1_1-x64.dll
C:UsersjoshuAnaconda3Librarybinlibcrypto-1_1-x64.dll

Anaconda Prompt locations:

(base) C:Usersjoshu>where libssl-1_1-x64.dll
C:UsersjoshuAnaconda3Librarybinlibssl-1_1-x64.dll

(base) C:Usersjoshu>where libcrypto-1_1-x64.dll
C:UsersjoshuAnaconda3Librarybinlibcrypto-1_1-x64.dll

Not sure if this matters but OPENSSL_CONF C:OpenSSL-Win64binopenssl.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%Librarymingw-w64bin; %CONDA_DIR%Libraryusrbin; %CONDA_DIR%Librarybin; %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-Win64binopenssl.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:ProgramDataAnaconda3libsite-packagespip (python 3.7)

Cmd prompt
C:UsersjoshuAppDataLocalProgramsPythonPython37Scriptspip.exe

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

(base) C:Usersjoshu>spyder.exe
Traceback (most recent call last):
  File "C:ProgramDataAnaconda3libsite-packagesspyderutilsexternalgithub.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:ProgramDataAnaconda3libsite-packagesspyderappmainwindow.py", line 3285, in main
    mainwindow = run_spyder(app, options, args)
  File "C:ProgramDataAnaconda3libsite-packagesspyderappmainwindow.py", line 3140, in run_spyder
    main.setup()
  File "C:ProgramDataAnaconda3libsite-packagesspyderappmainwindow.py", line 809, in setup
    from spyder.plugins.console import Console
  File "C:ProgramDataAnaconda3libsite-packagesspyderpluginsconsole.py", line 37, in <module>
    from spyder.widgets.reporterror import SpyderErrorDialog
  File "C:ProgramDataAnaconda3libsite-packagesspyderwidgetsreporterror.py", line 26, in <module>
    from spyder.widgets.github.backend import GithubBackend
  File "C:ProgramDataAnaconda3libsite-packagesspyderwidgetsgithubbackend.py", line 33, in <module>
    from spyder.utils.external import github
  File "C:ProgramDataAnaconda3libsite-packagesspyderutilsexternalgithub.py", line 58, in <module>
    from urllib.request import build_opener, HTTPSHandler, HTTPError, Request
ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (C:ProgramDataAnaconda3liburllibrequest.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

Содержание

Ошибка
Решение
Похожие статьи

Если вы пытаетесь использовать

pip

и получаете ошибку

WARNING: 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

Значит у вас не установлены библиотеки для работы с ssl.

Как вариант решения — предлагаю установить их и потом заново скачать

Python

и установить с помощью

configure make install

В

Ubuntu

,

Debian

и других .deb

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

В

CentOS

,
RedHat и других .rpm

sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel zlib* libffi-devel readline-devel tk-devel

Следующая команда подойдёт для всех

Linux

wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz ; tar xvzf Python-3.9.1.tgz ; cd Python-3.9.1 ; ./configure ; sudo make install

Если всё хорошо вы сможете пользоваться pip.

Если не помогло — попробуйте сперва удалить старый Python и только потом ставить новый

Подробнее об установке Python в

Linux

читайте

здесь

Похожие статьи

Сложности при работе с Python
Python
Установлено несколько версий Python
Установить дополнительную версию Python
Проверка системного пути
Куда устанавливаются различные версии Python
Установить пакет для определённой версии Python
AttributeError: partially initialized module ‘datetime’ has no attribute ‘date’
ModuleNotFoundError: No module named ‘requests
ModuleNotFoundError: No module named ‘urllib2
ModuleNotFoundError: No module named numpy
SyntaxError: Missing parentheses in call to ‘print’
SyntaxError: Non-ASCII character
TabError: inconsistent use of tabs and spaces in indentation
TypeError: getsockaddrarg: AF_INET address must be tuple, not str
TypeError: unsupported operand type(s) for +:
TypeError: module object is not callable
TypeError: ‘str’ object is not callable
TypeError: __init__() got an unexpected keyword argument ‘capture_output’
TypeError: ‘generator’ object is not subscriptable
virtualenv : The term ‘virtualenv’ is not recognized
Не активируется виртуальное окружение
SSL module is not available
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x90 in position

To solve pip is configured with locations that require TLS/SSL however the SSL module in Python is not available error you need to add anaconda into the path variable and it will resolve this error.

Contents

  1. How pip is configured with locations that require TLS/SSL however the ssl module in Python is not available Error Occurs.
  2. Solution 1: add Anaconda to the PATH
  3. Solution 2: install OpenSSL
  4. Solution 3: install libssl-dev
  5. Frequently Asked Questions
  6. Summary

I am just trying to install the module with the pip command but I am facing the following error.

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

Solution 1: add Anaconda to the PATH

  • First of all, you need to check conda installation path.
  • Just Open Anaconda Prompt and type this command: where conda
  • Then Press the windows key and type Open Advanced System Settings.
  • Now, Click on Environment Variables.
  • Edit Path variable.
  • And Then Add New Path. In my case
 C:UserssscAnaconda3Scripts

 C:UserssscAnaconda3

 C:UserssscAnaconda3Librarybin
  • Just add above 3 in PATH variable.
  • Then, Open Command Prompt and Check Versions
  • And type conda install anaconda-navigator in cmd then press y
  • Now your error must be solved.

Solution 2: install OpenSSL

Here pip doesn’t work because of ssl and you ask to install ssl, with pip.

  1. first, install OpenSSL, please refer to this page
  2. install python and ./configure --with-openssl=/home/username/openssl. download python source from https://www.python.org/downloads/source/ such as Python-x.x.x.tgz, then tar -xvf Python-x.x.x.tgz, and cd Python-x.x.x, do /configure –with-openssl=/home/username/openssl.
  3. at last, run python3 -m ssl and nothing outputs, it’s ok.

Solution 3: install libssl-dev

If You are using Linux then Just install libssl-dev. Run this command in your terminal.

sudo apt-get install libssl-dev

And now, Your error will be solved.

Frequently Asked Questions

  1. How To Solve pip is configured with locations that require TLS/SSL however the ssl module in Python is not available Error ?

    To Solve pip is configured with locations that require TLS/SSL however the ssl module in Python is not available Error Just Open Anaconda Prompt and type this command: where conda Then Press windows key and type Open Advanced System Settings. Now, Click on Environment Variables. Edit Path variable. And Then Add New Path. In my case C:UserssscAnaconda3Scripts; C:UserssscAnaconda3; C:UserssscAnaconda3Librarybin; Just add above 3 in PATH variable. Then, Open Command Prompt and Check Versions And type conda install anaconda-navigator in cmd then press y Now your error must be solved.

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

    To Solve pip is configured with locations that require TLS/SSL however the ssl module in Python is not available Error Just Open Anaconda Prompt and type this command: where conda Then Press windows key and type Open Advanced System Settings. Now, Click on Environment Variables. Edit Path variable. And Then Add New Path. In my case C:UserssscAnaconda3Scripts; C:UserssscAnaconda3; C:UserssscAnaconda3Librarybin; Just add above 3 in PATH variable. Then, Open Command Prompt and Check Versions And type conda install anaconda-navigator in cmd then press y Now your error must be solved.

Summary

The best and most effective solution is just to add an anaconda in the path variable and then retry to install the pip package will resolve your error. comment below which solution worked for you.

Also, Read

  • ‘conda’ is not recognized as internal or external command
  • Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist

When I import the python ssl module just after python is installed, it is prompted that ssl module cannot be found like below. This article will tell you how to resolve it.

$ python
Python 2.7.15 (default, Oct 23 2018, 18:08:43) 
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python27/lib/python2.7/ssl.py", line 60, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>

1. Verify Openssl Package Has Been Installed Correctly.

First, I use the below command to check whether the openssl package has been installed correctly or not. Then I found the package openssl-devel is missing.

$ rpm -aq|grep openssl
openssl-0.9.8e-20.el5
openssl-0.9.8e-20.el5

2. Install openssl-devel Package With Yum.

$ yum install openssl-devel -y

3. Check openssl-devel Package Installation Result.

Now check the openssl package again, you can find openssl-devel has been installed.

$ rpm -aq|grep openssl
openssl-devel-1.0.1e-57.el6.x86_64
openssl-1.0.1e-57.el6.x86_64

4. Recompile Python.

Edit python setup file /src/Python-2.7.15/Modules/Setup with below source code.

# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c 
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl 
-L$(SSL)/lib -lssl -lcrypto

Then go to the python source code directory and rebuild the python executable.

$ cd /src/Python-2.7.15/
$ make
$ make install

5. Import Python ssl Module Again.

Now import ssl module in python interactive command console again, the error no module named _ssl will disappear.

$ python
Python 2.7.15 (default, Oct 23 2018, 19:08:43)
>>> import ssl
>>>

6. Question & Answer.

6.1 SSL module is not available in the current python installation.

After installing Python successfully, I find I can not use pip to install python packages. My Python version is 3.7 and the pip install package-name command return an error message that said the SSL module is not available in the current python installation.

This error is similar to the error in this article, below are the steps to fix it in different OS.

6.1.1 For Ubuntu you can follow the below steps.
  1. Run the command $ sudo apt-get install libbz2-dev libc6-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libsqlite3-dev libssl-dev tk-dev in the terminal to install the packages that Python and SSL required.
  2. Download the python source file from https://www.python.org/ftp/python/, save the download file to a local folder and unzip the archive file.
  3. Run the command ./configure in the above archive file unzipped directory.
  4. Run the command make && sudo make install to build the Python and install it to your Ubuntu.
  5. Now you can run the command pip install pcakage-name to install python packages on your Ubuntu.
6.1.2 For Windows you can follow the below steps.
  1. If you encounter such an error on Windows, it is mainly because the libcrypto-1_1-x64.dll or libssl-1_1-x64.dll installed on your Windows has been replaced by another program that you have installed later.
  2. The above two DLL files are saved in the directory WindowsSystem32. You can replace them back manually if you have another machine that can run the pip install command without the error.
  3. If you have only one machine, you can install win 32 openssl again, and the win 32 OpenSSL installation will replace the above DLL files with the newest version.

During the process of python development, I meet the SSLError Can’t connect to HTTPS URL because the SSL module is not available in several cases. In this article, I will tell you how to reproduce and fix this error with examples.

1. Case1: Meet The Error When Executing Pip Install Command In Eclipse.

  1. I want to import the python pandas module in my python source code, when I run the python source code in the Eclipse PyDev project, it shows an error on the line of the source code import pandas as pd.
  2. The error message is Unresolved import: pd. This means that the python interpreter which I used in my eclipse PyDev project does not install the pandas module.

1.1 Steps To Reproduce The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I follow the article How To Install Python Library ( such as Pandas ) In PyCharm, PyDev Eclipse to install the python pandas library in my Eclipse PyDev project.
  2. When I run the command install pandas in the Manage pip window ( please refer to the above article section 2.2 ), it shows the bellow error message in the text area under the Command to execute input text box.
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    WARNING: 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/pandas/
    WARNING: 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/pandas/
    WARNING: 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/pandas/
    WARNING: 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/pandas/
    WARNING: 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/pandas/
    ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
    ERROR: No matching distribution found for pandas
    Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    FINISHED
  3. This error confused me a lot of time, but after investigating, I finally find the method to fix it.

1.2 How To Fix The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I use the Anaconda in my example, and my python interpreter is an anaconda virtual environment also.
  2. First I open a dos window and run the command conda info to get the Anaconda basic information such as the Anaconda home directory ( it is C:Userszhaosonganaconda3 in this example ).
    C:Userszhaosong>conda info
    
         active environment : None
           user config file : C:Userszhaosong.condarc
     populated config files : C:Userszhaosong.condarc
              conda version : 4.10.1
        conda-build version : 3.20.5
             python version : 3.8.5.final.0
           virtual packages : __win=0=0
                              __archspec=1=x86_64
           base environment : C:Userszhaosonganaconda3  (writable)
          conda av data dir : C:Userszhaosonganaconda3etcconda
      conda av metadata url : https://repo.anaconda.com/pkgs/main
               channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                              https://repo.anaconda.com/pkgs/main/noarch
                              https://repo.anaconda.com/pkgs/r/win-64
                              https://repo.anaconda.com/pkgs/r/noarch
                              https://repo.anaconda.com/pkgs/msys2/win-64
                              https://repo.anaconda.com/pkgs/msys2/noarch
              package cache : C:Userszhaosonganaconda3pkgs
                              C:Userszhaosong.condapkgs
                              C:UserszhaosongAppDataLocalcondacondapkgs
           envs directories : C:Userszhaosonganaconda3envs
                              C:Userszhaosong.condaenvs
                              C:UserszhaosongAppDataLocalcondacondaenvs
                   platform : win-64
                 user-agent : conda/4.10.1 requests/2.24.0 CPython/3.8.5 Windows/10 Windows/10.0.19041
              administrator : False
                 netrc file : None
               offline mode : False
  3. I add the below 3 paths to my Windows Path environment variable value, then the error is fixed. You should use your own Anaconda path value to replace the one in my example. You can refer to the article How To Set Windows Environment Variables to learn more.
    C:Userszhaosonganaconda3
    
    C:Userszhaosonganaconda3Scripts
    
    C:Userszhaosonganaconda3Librarybin

2. Case 2: Meet The Error When Using Python Urllib3 To Get Webpage Html With HTTPS URL.

  1. When I use the python module urllib3 to retrieve a webpage Html source code using an HTTPS web page URL, it also throws an error like the above.
  2. Below is the detailed error stack trace.
    Exception has occurred: MaxRetryError
    HTTPSConnectionPool(host='www.bing.com', port=443): Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
  3. In this case, I also use anaconda as the python environment and the editor is visual studio code, and after I add the below 3 strings in the windows PATH system environment variable, the error is fixed also, you can refer to section 1.2 of this article to get the detailed explanation.
    C:Userszhaosonganaconda3
    
    C:Userszhaosonganaconda3Scripts
    
    C:Userszhaosonganaconda3Librarybin

Problem

When you are trying to upgrade pip in Jupyter Notebook you are getting warning message.

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

Command used:

pip install --upgrade pip

Symptom

Error message observed when you are installing packages or upgrading pip in Jupyter Notebook.

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: 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/
WARNING: 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/
WARNING: 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/
WARNING: 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/
WARNING: 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 /opt/conda3/lib/python3.5/site-packages (19.3.1)
WARNING: You are using pip version 19.3.1; however, version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Environment

WSL version (1.2.3.1 patch 11)

Runtime environment: Jupyter with Python 3.5, Scala 2.11, R 3.4.3, Spark 2.2.1

Resolving The Problem

The issue observed because the project is created on WSL 1.2.0. The issue is resolved by moving assets to new project that is created on WSL 1.2.3.1.

Document Location

Worldwide

[{«Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Product»:{«code»:»SSHGWL»,»label»:»IBM Watson Studio Local»},»ARM Category»:[{«code»:»a8m0z000000bnp2AAA»,»label»:»Modeling->Notebook — Jupyter»}],»ARM Case Number»:»TS004092327″,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»1.2.0″}]

This solution worked very well for me:

SSL issues with Python 3.7 Install From Source

Thanks Josh.

I make a summary of the procedure:


Steps

I decided to just install openSSL again by pulling down the newest version of the source code.

sudo apt-get install -y wget
mkdir /tmp/openssl
cd /tmp/openssl
wget https://www.openssl.org/source/openssl-1.0.2q.tar.gz
tar xvf openssl-1.0.2q.tar.gz
cd /tmp/openssl/openssl-1.0.2q
./config
make
sudo make install

The key here (and the reason i’m writing this post) is to show how to tell Python where this new installation of openSSL is. By default your manual install of openSSL will be in /usr/local/ssl. You can confirm this by checking the modify time of the ssl directory with ls -la /usr/local/ssl.

By default, Python isn’t going to look here. We need to fix that. To begin, run the first part of the Python install script (as seen below).

# Install requirements
sudo apt-get install -y build-essential
sudo apt-get install -y checkinstall
sudo apt-get install -y libreadline-gplv2-dev
sudo apt-get install -y libncursesw5-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y tk-dev
sudo apt-get install -y libgdbm-dev
sudo apt-get install -y libc6-dev
sudo apt-get install -y libbz2-dev
sudo apt-get install -y zlib1g-dev
sudo apt-get install -y openssl
sudo apt-get install -y libffi-dev
sudo apt-get install -y python3-dev
sudo apt-get install -y python3-setuptools
sudo apt-get install -y wget
# Prepare to build
mkdir /tmp/Python37
cd /tmp/Python37
# Pull down Python 3.7, build, and install
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xvf Python-3.7.0.tar.xz

Now STOP, cd to /tmp/Python37/Python-3.7.0 and open up the file Modules/Setup.dist

You should see the following lines COMMENTED.

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
 _ssl _ssl.c 
    -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl 
    -L$(SSL)/lib -lssl -lcrypto

What you need to do is UNCOMMENT these lines so that they are seen during our Python compile. Now you can finish up by running that last few lines of our python script.

cd /tmp/Python37/Python-3.7.0
./configure --enable-optimizations
sudo make altinstall

At this point I now had a working python and pip (mapped to python3.7 and pip3.7 in my path).

Like this post? Please share to your friends:
  • Ssl certificate problem self signed certificate windows
  • Sshd exe windows 10 что это
  • Ssh что это за папка windows 10
  • Ssh туннель windows 10 через cmd
  • Ssh сервер для windows server 2008 r2