Search code examples
pythonmacospippycharm

'install' of pip failed at Pycharm, but worked at Jupyternotebook. Why?


I'm only super beginner using Python. And I'm looking for help.
My objective is to install 'selenium' through Pycharm. I've tried this method:

pip install selenium

My Pycharm was able to recognize 'pip' but not 'install'.
I've tried several methods to solve this.

  • Using Python3.9 interpreter (failed)
  • Using Conda interpreter (failed)
  • re-installing pip (failed)
  • installing selenium @ Jupyternotebook (worked)
  • directly adding the package through Pycharm Interpreter settings (worked)

I some how figured it out through the two methods below, but I would like to make *'pip'* working on my Pycharm. And I think this is the problem of **path setting**, because *'pip install'* worked at Jupyternotebook. Does anybody have solution to this situation?
. Operating System : MacOS
Conda Path : /Users/****/opt/anaconda3/envs/pythonProject/bin/python
Python Path : /usr/local/bin/python3.9

Solution

  • You have multiple pythons installed, one that is being used in the jupyter-notebook kernel, one in pycharm, and one in the conda environment. You could install pip for all these pythons.

    You can check you pycharm python interpreter in pycharm settings by following: PyCharm | Preferences | Project | Python Interpreter. And you can also set PyCharm to use the python that jupyter-notebook is using. jupyter-notebook kernels can be viewed via: jupyter kernelspec list