Already installed pyzmq but still getting "ImportError: No module named zmq"

Viewed 38764

I am trying to get ipython notebook run. I already installed pyzmq. Do you know why it's still giving this error?

8 Answers

check what version on python you installed it with

python --version

When you run the application make sure you are using that same version you used to install it with.

The problem for me was that I installed it for python 3.6 but ran it under python 2.7

you should add Phython path to windows local variable PATH before install zmq

For me the solution was to rename my script from zmq.py to anything else.

This happens because using the name zmq.py crates a name conflict with the package as python tries to include the script itself rather than the library as scripts have priority in the include hierarchy.

I had a file that was trying to import zmq that was throwing:

ModuleNotFoundError: No module named 'zmq'

But pip install zmq or pip install pyzmq kept telling me I had a version already installed, and thus Requirement already satisfied at Library/blahblah/Python/3.6 ...

I've already aliased pip3 to pip, but trying pip3 didn't work either

I wound up having to reset my $PYTHONPATH and deleted that Python 3.6 install I didn't actually need.

After that pip install pyzmq STILL didn't work though.

What finally worked was pip3 install zmq ... Weird since I already had that aliased, but something w/the paths might still be screwy.

Related