pythonpipspyder

Spyder: pip under different interpreter is used for installing packages


I started using Spyder recently. I have Python 3.7 and 3.11 installed in my machine. I want to use the second one (3.11), therefore, I have successfully (confirmed by checking in console sys.path) adjusted the interpreter in the preferences: enter image description here

Nevertheless, when I want to install a package using pip in Spyder's console (!pip install NAME), the pip under Python 3.7 is utilized, and the package is installed in the Lib folder of Python 3.7:

enter image description here

Is it is possible to use the pip version installed under Python 3.11 interpreter in Spyder's console for installing the desired modules?


Solution

  • The reason was that Python 3.7 was the default one as its path was prioritized in the environment variables. By setting 3.11 as the default like in the following image and rebooting, fixes the issue.

    environment variables

    spyder console