conda virtual environment not finding zmq dll

Answered

Hi there,

I am struggling to fix the following problem. I have set up a virtual environment in conda with python 3.7 and pyzmq. if i launch python from the anaconda prompt and do import zmq, no problem.

if i go into pycharm, set up the project interpreter using the "existing conda environment" option and i do import zmq inside the python console it fails:

import zmq
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "...\_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "...\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
...

ImportError: DLL load failed: The specified module could not be found.

...when zmq try to import the libzmq.dll.

 

Now if i launch pycharm from the anaconda prompt with the virtual environment activated.. the same import works in pycharm.

What am i not configuring correctly in pycharm so that it picks up/activates whatever setup the conda activated virtual environment is doing?

NOTE 1: for other libraries that do not rely on external dlls, there is no problem.

NOTE 2: i tried setting up the conda virtual environment from pycharm directly, same problem.

 

thanks for your help, let me know if you need more details.

 

0
3 comments
Avatar
Permanently deleted user

So i finally found out the issue.

it is because the %virtual environment%\Library\bin is missing from the windows path variable. so zmq never finds the DLL.

somehow conda correctly set up the os environment path variable, but pycharm does not.

is it a setting somewhere? or a bug?

0

Hi, it's a bug, unfortunately. PY-27234 I believe.

1
Avatar
Permanently deleted user

Yeah ok, I upvoted it.
Thanks.

0

Please sign in to leave a comment.