0

Pycharm had been working well on Ubuntu18. Using Pycharm I had created several venvs and successfully installed packages in those different venvs. Today I created a new venv with Pycharm, tried to install a package and got this error message.

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 '/home/grass/PycharmProjects/astro/venv/bin/python'.

Long story short, couldn't solve the problem. Reinstalled Pycharm, tried Mate18 with Pycharm instead with no success, and finally a pristine install of Mate20.

Python is what comes with Mate20; there are no upgrades. After I installed PyCharm I tried to install a package and the process failed again, with the above message, which is common to all my attempts on various machines.

From the terminal of the fresh install of Mate20 I get this

grass@m20:~$ which python3
/usr/bin/python3
grass@m20:~$ which pip3
/usr/bin/pip3
grass@m20:~$ python3 --version
Python 3.8.5
grass@m20:~$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

and from the PyCharm terminal I get this

(venv) grass@m20:~/PycharmProjects/pythonProject$ which python
/home/grass/PycharmProjects/pythonProject/venv/bin/python
(venv) grass@m20:~/PycharmProjects/pythonProject$ which python3
/home/grass/PycharmProjects/pythonProject/venv/bin/python3
(venv) grass@m20:~/PycharmProjects/pythonProject$ which pip
/home/grass/PycharmProjects/pythonProject/venv/bin/pip
(venv) grass@m20:~/PycharmProjects/pythonProject$ which pip3
/home/grass/PycharmProjects/pythonProject/venv/bin/pip3
(venv) grass@m20:~/PycharmProjects/pythonProject$ pip --version
pip 20.3 from /home/grass/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip (python 3.8)
(venv) grass@m20:~/PycharmProjects/pythonProject$ pip3 --version
pip 20.3 from /home/grass/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/pip (python 3.8)
(venv) grass@m20:~/PycharmProjects/pythonProject$ python --version
Python 3.8.5
(venv) grass@m20:~/PycharmProjects/pythonProject$ python3 --version
Python 3.8.5
(venv) grass@m20:~/PycharmProjects/pythonProject$ 

Packages can be installed from the PyCharm terminal eg

(venv) grass@m20:~/PycharmProjects/pythonProject$ pip install astral
Collecting astral
  Downloading astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting pytz
  Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB)
     |████████████████████████████████| 509 kB 2.5 MB/s 
Installing collected packages: pytz, astral
Successfully installed astral-2.2 pytz-2020.4

What is going on with PyCharm? (or me!) Thanks.

tom fowle
  • 1
  • 1
  • 3
  • After good night's sleep I tried again with a fresh install of ubuntu18: Got the same problem. Downgraded PyCharm to version pycharm-community-2019.3.5.tar.gz and I now have PyCharm which will install packages (again). – tom fowle Dec 01 '20 at 22:54
  • That was probably https://stackoverflow.com/a/65086897/2787185, updating to 2020.2.5 should resolve the problem as well. – Pavel Karateev Dec 02 '20 at 11:55
  • Thanks Pavel, I have noted that the upgrade is available. It's still a mystery, though, why my first installation worked OK for a few weeks before it became a problem. Maybe I accidentally upgraded it while I was sober. – tom fowle Dec 03 '20 at 08:12

0 Answers0