8

I am using python 3.6.5 with PyCharm.

While trying to install any package, it gives the error "Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\projectPath\venv\Scripts\python.exe'"

Project path and actual python installed paths are different.

In settings of PyCharm, pip version is 19.0.3 and latest version is 19.3.1

Also, "python -m pip --version" from command prompt says pip version is 9.0.3

What do I do?

techenthu
  • 158
  • 11
user3471438
  • 333
  • 1
  • 2
  • 12

8 Answers8

7

I imagine that you have more than one Python installed in your system. you should go to Pycharm --> file> settings> project>project interpreter.

you should find the other Python instance on your system and try to change your interpreter to that one. if it does not appear in the list click on the button that looks like star in front of the project interpreter.

I had the same problem. I realized that I installed one python by myself and another is installed while installing PyCharm.

After changing my interpreter I do not receive that error anymore.

user13436372
  • 79
  • 1
  • 2
1

This error occurred to me too when using PyCharm, and trying to install MeCab in it. And by choosing mecab-python3 instead of just mecab (which is what is for Python2 I assume...). You might install the package compatible to the Python version used in the package, but not to yours, which is that PyCharm refers to'dir:\projectPath\venv\Scripts\python.exe' . So you should choose the different version of the package, or change interpreter to another.

Mat Watershed
  • 45
  • 3
  • 7
1

I got the same error along with no such option: --build-dir after upgrading pip from PyCharm's (2020.1 #PY-201.6668.115) terminal (PyCharm didn't allow me to do so from interpreter's settings).

Turned out older versions of PyCharm rely on --build-dir which was removed in newer versions of pip. To resolve the issue I had to downgrade pip.

Solution was found here

Ledorub
  • 354
  • 3
  • 9
0

Faced same issue after trying to change the file path.

  1. Tried changing the interpreter location but it dint work for me. so I uninstalled pycharm and re-installed it. working fine now.
Basa
  • 1
0

I faced the same problem on Windows-10 (PyCharm 2020.1.2 version) when installing h5py package. I didn't want to change my interpreter as that will raise other compatibility errors in my code.

In my case:

  • What didn't work: upgrading the pip
  • What worked: I chose old h5py version-2.10 (instead of the latest h5py version selected by default by PyCharm) and it worked.

Mentioning just in case if this works for someone. Uninstalling both Python and Pycharm is too much to do for this error (in my opinion).

nuki
  • 101
  • 5
0
  1. File-> settings

enter image description here

  1. searching for project -> and choosing "python interpreter"

enter image description here

  1. in "python interpreter" tab choosing "show all"

enter image description here

  1. pressing in the left down side on "+" (add)

enter image description here

  1. adding the right direction of python installed place and press "ok"

enter image description here

  1. removing the previous version
Vladi
  • 1,662
  • 19
  • 30
-2

I faced the same error while using Python 3.7.5 and Pycharm 2019.1.2 for my Django project.

It also causes failure in execution of many other python commands, and is not caused by environment variables or path. I guess it's because some python files are broken or corrupted.

The easiest and fastest way I found to get out of this was :-

  1. Uninstall Python.
  2. Uninstall Pycharm.
  3. And Reinstall latest versions of both.
Artemis
  • 2,553
  • 7
  • 21
  • 36
-3

I had the same problem and but see solution uninstall IDLE python and pycharm and install least version

Uninstall Python.
Uninstall Pycharm.
And Reinstall latest versions of both.
  • 1
    This exact solution has already been proposed: https://stackoverflow.com/a/60194400/13525512 – Tranbi Aug 09 '21 at 06:08