Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is PyCharm unable to find the correct verion of pip to install a Python module?

OSX: 10.9.5

PyCharm: 4.5

I am working on project in PyCharm IDE, using the 2.7.3 Python interpreter and need to import thepsycopg2 module. I tried to install the module with PyCharm, but it failed and asked me to do it manually:

Image of error message

So I typed that command in the bash shell, the module installed and now it shows up in the project interpreter 2.7.2 but not in 2.7.3 !!!!!

Maybe the pip version is too old? I upgraded pip from the bash shell: pip install --upgrade pip

  • python 2.7.2 shows version 7.1.0
  • python 2.7.3 shows version 1.5.6
like image 804
XY6 Avatar asked Jul 27 '15 18:07

XY6


2 Answers

You should open Preferenes > Project: (projectname) > Project Interpreter.

enter image description here

Choose the interpreter you want from the dropdown. If you have installed Python with Homebrew, as I have, then you maybe want to choose one of the python interpreters from the Cellars to ease usage of other packages you may have installed with Homebrew.

like image 164
patriques Avatar answered Nov 15 '22 08:11

patriques


It might simply be that your system doesn't have pip installed, only pip3.

My system only showed me having pip3 not pip. Use which pip3 and which pip to see if you have either.

I decided to update pip3, first trying pip3 install --upgrade pip3 which, oddly, returned: ERROR: No matching distribution found for pip3

Next, I ran pip3 install --upgrade pip and now PyCharm can install packages from the GUI.

like image 25
Conrad Avatar answered Nov 15 '22 06:11

Conrad