pycharm no module named redis

10,814

Solution 1

As per my understanding pycharm will say "No module named redis" if you haven't set up python interpreter in pycharm or in case there is no such module you are trying to use installed in the python interpreter you are currently using for pycharm.

To add python interpreter to pycharm go to File -> Settings -> Python interpreter

enter image description here

Solution 2

Ansuman's tip got me part way there, but import redis was still going red. I had an interpreter selected, but it turned out I did not have pip installed, nor did I have the redis package installed.

To get those, go to File > Settings > Python Interpreter (or PyCharm > Preferences > Python Interpreter on Mac) and select Configure Interpreters. At the bottom it will suggest to install pip (sorry, no screenshot). Do this. After pip is installed, install the redis module by selecting Install.

In the new window, search on redis. Select redis (you may have to scroll down, it didn't appear at the top for me), then select Install Package.

Installing redis from available packages on PyCharm

Obviously, this should work for all packages, not just redis.

Share:
10,814

Related videos on Youtube

JavaFreshman
Author by

JavaFreshman

Updated on June 04, 2022

Comments

  • JavaFreshman
    JavaFreshman about 2 years

    I installed python,Django and Redis. In Vim I use “import redis” is OK, when I use pycharm IDE to code, I write “import redis” , the pycharm tip “no module named redis”, why? what should I to do ?

  • JavaFreshman
    JavaFreshman almost 11 years
    I installed pip, all is OK now !! thank you , but I still don't know why?
  • 3lokh
    3lokh over 9 years
    Hello I had similar issue, initially I did't have pip installed and I manually installed it from terminal. But pycharm still shows pip is not