1

I am trying to install the python package py-pde.

My current python version is 3.9.

I pip install using the command 'pip install py-pde' on the terminal.

However, when I try to install it on my IDE - PyCharm - I get this error:

Collecting py-pde
  Using cached py_pde-0.27.1-py3-none-any.whl (269 kB)
Requirement already satisfied: matplotlib>=3.1.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from py-pde) (3.6.2)
Collecting numba>=0.56.0
  Using cached numba-0.56.4.tar.gz (2.4 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/sl/b99vml7s45q3zx3wb1fqvq240000gp/T/pip-install-pu5ucxpg/numba_1e4a8190083b40fba0897686608f79d0/setup.py", line 51, in <module>
          _guard_py_ver()
        File "/private/var/folders/sl/b99vml7s45q3zx3wb1fqvq240000gp/T/pip-install-pu5ucxpg/numba_1e4a8190083b40fba0897686608f79d0/setup.py", line 48, in _guard_py_ver
          raise RuntimeError(msg.format(cur_py, min_py, max_py))
      RuntimeError: Cannot install on Python version 3.11.0; only versions >=3.7,<3.11 are supported.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Any ideas what's wrong here?

Specifically, it says can't install on Python 3.11, even though I checked my python version using pip --version to be 3.9.

Not sure what's wrong. Help appreciated.

sinoroc
  • 18,409
  • 2
  • 39
  • 70
  • 1
    Seems like you have more than one Python version installed. Which is not a problem at all. Perfectly normal to have more than one Python version. -- Now in the console your `pip` is connected to Python 3.9 whereas PyCharm seems to prefer Python 3.11 (and its *pip*). Nothing wrong with that. You need to tell PyCharm to use whatever Python you want it to use for this one particular project of yours. I know nothing of PyCharm, I do not know how you should do that. – sinoroc Feb 14 '23 at 12:57

1 Answers1

0

Should be as simple as alt+ctrl+s to go to settings.

Then navigate to Project: "Your project" >> Python Interpreter. Then just browse to the interpreter you want to use instead of 3.11.

Edit: Here's a link to JetBrains (PyCharm parent company) documentation that covers changing your interpreter.