Python Console Not Loading on 2019.2.3

Answered

I just started using PyCharm and am trying to get it working with the latest release of Anaconda. However, when I open the program, the Console doesn't load correctly and instead gives the following traceback:

"C:\Users\MyName\Dropbox\Coding Projects\iTunes Export File Checker\venv\Scripts\python.exe" "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\helpers\pydev\pydevconsole.py" --mode=client --port=64316
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\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.2.3\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.2.3\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.2.3\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.2.3\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.2.3\helpers\third_party\thriftpy\_shaded_thriftpy\transport\sslsocket.py", line 7, in <module>
import ssl
File "C:\ProgramData\Anaconda3\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 procedure could not be found.
Process finished with exit code 1

I have read a few other posts, including this one that looked promising (https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error), but it did not fix the issue even after restarting PyCharm.

Any ideas what can be done about this so I can use the Python Console?

Many thanks!

9 comments
Comment actions Permalink

Hi!
Did you use Anaconda's python interpreter as a Base for this venv creation?

0
Comment actions Permalink

This was a pain in my arse for days. I finally dug this solution up which worked (I use Anaconda downloaded 5 days ago):

https://stackoverflow.com/a/54932141

 

"

If you are on Windows and use anaconda this worked for me:

I tried a lot of other solutions which did not work (Environment PATH Variable changes ...)

The problem can be caused by DLLs in the Windows\System32 folder (e.g. libcrypto-1_1-x64.dll or libssl-1_1-x64.dll or others) placed there by other software.

The fix was installing openSSL from https://slproweb.com/products/Win32OpenSSL.html which replaces the dlls by more recent versions.

"

0
Comment actions Permalink

Sergey - Confirmed, I used Anaconda's python interpreter when the venv was created.

 

Ben - This was an interesting idea. I downloaded and installed the "Win64 OpenSSL v1.1.0L" version from that site, but the issue in PyCharm remains. Did you do anything else (beyond the simple install) to get this to work?

0
Comment actions Permalink

I downloaded Win64OpenSSL_Light-1_1_1d.exe During the install make sure to select updating the windows system files. It's on the last screen.

I believe I also removed all interpreters, then added a new one based on a conda venv I made following this: https://stackoverflow.com/a/21707160

Also for good measure close your project, then go to the windows folder and backup/delete (or rename) the .idea folder there. You can also relaunch pycharm but I don't think that will matter YMMV

Lemme know how it works!

0
Comment actions Permalink

@Cyber558

It's not recommended to create virtualenv using Anaconda's python as a Base. Our fault is that we can suggest it by default in some cases.

It's better to create virtualenv using some standard Python executable (e.g. from https://python.org).

0
Comment actions Permalink

Sergey - I installed Python 3.7.5 from python.org as you suggested, and when I use this to create my virtualenv, the python console appears to work properly. Now, with plain Python as the base for my venv, is there a way I can take advantage of all of the packages that come preinstalled with Anaconda while building my project in PyCharm 2019.2.3 (with Anaconda Plugin, I tried installing this "special" sounding version, not sure what the difference is though)?

Thanks!

0
Comment actions Permalink

Hmm, why don't you use a conda environment then?
This is the proper way of using Anaconda's packages/advantages in your project.

You can even configure Anaconda's base interpreter as an existing conda environment and then use all of its preinstalled libraries.

0
Comment actions Permalink

You've just gone a bit beyond my level of understanding of virtual environments. How do I create a conda environment?

To create a venv today, when I create a new project I just choose one of the options in the "Base Interpreter" drop-down list in PyCharm. Right now, the only two options are "C:\ProgramData\Anaconda3\python.exe" and "C:\Program Files\Python37\python.exe". Choosing the "Anaconda3\python.exe" interpreter is what gives me the problem this thread is all about. Choosing "\Python37\python.exe", as you just suggested works fine, but doesn't give me access to all of the Anaconda packages I need for the projects I am working on.

Any advice on how I can create/use a Conda environment in PyCharm? Does a Conda venv come with all of the Anaconda packages pre-installed?

Many thanks!

0

Please sign in to leave a comment.