SSL module not available, unable to install packages
Hello everyone,
the problem I have seems to reoccur for several other users but the suggestions I read so far to solve it did not help me. When I want to install a package to my virtual environment an error occurs that states that the SSL module is not available. But when I run pip within the conda prompt everything works fine. OpenSSL is updated, as well as pip. What seems strang to me is that anaconda has the latest version of pip (19.1.1), while in the venv it says the version is 19.0.3. Im using Windows 10, Anaconda3, Python 3.7 and Pycharm2019.1.1.
Non-zero exit code (1)
Collecting PyQt5
Could not fetch URL https://pypi.org/simple/pyqt5/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyqt5/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
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
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/pyqt5/
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/pyqt5/
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/pyqt5/
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/pyqt5/
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/pyqt5/
ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none)
ERROR: No matching distribution found for PyQt5
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
请先登录再写评论。
Please see https://youtrack.jetbrains.com/issue/PY-35141 and check if conda is installed in non-default location.
Also see https://youtrack.jetbrains.com/issue/PY-34959 and related issues.
As the workaround, please try running PyCharm from the terminal using `<pycharm_installation>/bin/pycharm.bat` , and activate the proper conda environment beforehand in that terminal session.
Conda was installed in a default version. It might acutally be, that DLLs are not loaded correctly. But a lot of the solutions are using the command line and as I am quite new to programming I do not completely understand what they mean. The same is true for your last statement. How do I activate the proper conda environment in the terminal session? Can you elaborate, please?
Hi, try the following
- run cmd.exe, e.g. by clicking Start Windows button and typing cmd and then Enter
- activate base conda interpreter by running the following line in the command line, change the path to your Anaconda installation
- activate conda environment with the line below and change <conda_venv_name> to your conda virtual environment name
- run PyCharm with bat file (change the path to PyCharm installation on your machine)
That instruction did not work ...
Any suggestion how to fix this ...
C:\Users\bhutada\PycharmProjects\project1\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\pydevconsole.py" --mode=client --port=49605
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\pydevconsole.py", line 5, in <module>
from _pydev_comm.pydev_rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_rpc.py", line 4, in <module>
from _pydev_comm.pydev_server import TSingleThreadedServer
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_server.py", line 4, in <module>
from _shaded_thriftpy.server import TServer
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\server.py", line 9, in <module>
from _shaded_thriftpy.transport import (
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\transport\__init__.py", line 57, in <module>
from .sslsocket import TSSLSocket, TSSLServerSocket # noqa
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\transport\sslsocket.py", line 7, in <module>
import ssl
File "C:\Users\bhutada\Miniconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1
Hi Shashi, please do not create pure Python virtual environments using Miniconda as a base. Either use interpreter from python.org or create conda environment in the first place. Mixing these two entities leads to such errors. We will explicitly prohibit such action in the future https://youtrack.jetbrains.com/issue/PY-35053
I had downloaded Minconda3 earlier. I just downloaded the PyCharm for the first time on Windows 10 and ran it for the first time ... how can I have it not look at MiniConda3 installation? I am confused. Trying out PyCharm for the first time and not able to create configuration. Any help is much appreciated.
You should pick conda when creating new project
or create new interpreter for an existed project
That worked. Thanks.
Thanks a lot Pavel Karateev. You have solved my problem