python no module name pika when importing pika

前端 未结 5 980
我寻月下人不归
我寻月下人不归 2021-01-06 11:19

I installed pika for python running on a mac

sudo pip install pika==0.9.8

I make sure is installed, this is the response when trying to rei

5条回答
  •  时光取名叫无心
    2021-01-06 12:08

    More likely you are running several versions of pip and python. Check your 'pip' and 'python' versions - you should use a 'pip' version corresponding to your 'python' version:

    # python --version
    Python 2.7.5
    # pip --version
    pip 9.0.1 from /usr/lib/python3.4/site-packages/pip-9.0.1-py3.4.egg (python 3.4)
    

    As you can see 'pip' will install modules for a python version different from the one I'm using. I used 'pip2' command for 'python2' (use pip3 for python3):

    # pip2 install pika
    

提交回复
热议问题