Home > other >  pip looking in wrong folder
pip looking in wrong folder

Time:08-15

My issue requires some backstory.

I was having some troubles with pip, so I reinstalled Python. After the reinstall pip began to work, but Pycharm, my IDE, could no longer find Python. When I reinstalled Python it created a new folder for itself (Python310), but Pycharm kept looking in the old folder (Python39). I couldn't figure out how to get Pycharm to look in the new folder. Even deleting and reinstalling it did nothing.

So, I renamed Python310 to Python39 and changed the PATH. Now Pycharm can find Python. But pip has developed a new and exciting error. When I try to use it I get the following message:

Fatal error in launcher: Unable to create process using '"C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe" "C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts\pip.exe" install numpy': The system cannot find the file specified.

If I read this correctly pip is still trying to look in Python310. Would you please tell me what I need to do to get pip to looking in the right place?

CodePudding user response:

So, to start. You don't fix this by renaming the folder where the interpreter resides. Even if that worked, it's not a fix. The name will say one thing, but it's actual version, compatible libraries, and anything else tied to the version number would be incorrect.

The problem you are having is that your IDE, PyCharm, needs to be configured for your project. You have to tell it where the Python interpreter is. This link is a good source and can help you with this:

https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#interpreter

I tried to take screenshots to be specific and for the sake of clarity, but their security policy prevented me from doing so. The headers you want to pay attention to are:

  • Configure a Python interpreter
  • Python interpreters in PyCharm
  • Setting an existing Python interpreter
  • Creating a new Python interpreter

The rest of the content is great as well, and may help answer questions you didn't know you had.

CodePudding user response:

try to uninstall all of the existing python versions. and install it again. using any of application allow you to delete most of files, so to prevent error when re-install .

CodePudding user response:

Option 1:

delete and reinstall again. and then when creating a project it should prompt you to pick a basic interpreter, choose python310 or whatever version you're using.

Option 2:

use a different IDE.

  • Related