0

When I try to install pyspark plugin in PyCharm, I get an error Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/usr/bin/python2.7' However, when I type pip --version in the terminal, I see this version:

pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

So, cannot figure out what am I doing wrong.

0

PyCharm can have more than one interpreter. When you run pip from the command line, the system is finding the first pip it can find based on your PATH settings, not necessarily the one you're using within PyCharm.

In Preferences -> Project at the top will be a dropdown of the python interpreters. Click the drop down, and show all. Then in a terminal window, ensure there's a pip for each one.

enter image description here

You would do this by running the ensurepip module using each python. So in my example highlighted I would run

/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/bin/python3 -m ensurepip

to ensure I have pip for that version of python. Do similar for the other pythons of interest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.