1

I try to install openai-gym library, so I run this command: pip install gym but I got this error:

Traceback (most recent call last): File "/usr/bin/pip", line 9, in from pip import main ImportError: cannot import name main

I searched and I got that https://stackoverflow.com/questions/49836676/error-after-upgrading-pip-cannot-import-name-main will help me, so I tried these commands: sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall but I got this error while running sudo python3 -m pip uninstall pip:

Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr You are using pip version 8.1.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

And finally when I run pip install --upgrade pip again I got this error:

Traceback (most recent call last): File "/usr/bin/pip", line 9, in from pip import main ImportError: cannot import n

It becomes a loop and I don't know what to do?! :(

Zeinab
  • 43
  • 10
  • 1
    Try this https://pip.pypa.io/en/stable/installing/ – Ashish Aug 17 '18 at 07:51
  • @Ashish I tried it and I got the message "Successfully installed pip-18.0", but when I run " sudo python3 -m pip uninstall pip" I got previous message again. :( – Zeinab Aug 17 '18 at 07:59
  • Possible duplicate of [Error after upgrading pip: cannot import name 'main'](https://stackoverflow.com/questions/49836676/error-after-upgrading-pip-cannot-import-name-main) – phd Aug 17 '18 at 13:16
  • @phd I saw that link before and I pointed to it in my question, but it didn't solve my problem. – Zeinab Aug 18 '18 at 07:36
  • @Ashish your link was usefull, thank you so much. – Zeinab Aug 18 '18 at 07:37

0 Answers0