Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip not working - ModuleNotFoundError: No module named 'runpy'

I have installed Python to C:\Python.

I have added the following paths to PATH environment variables:

  • C:\Python
  • C:\Python\Lib\site-packages
  • C:\Python\Scripts

I have installed get-pip.py to desktop successfully, returns the following:

Collecting pip   Using cached
https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Collecting setuptools   Using cached
https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl
Collecting wheel   Using cached
https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel Successfully
installed pip-10.0.1 setuptools-40.0.0 wheel-0.31.1

When trying to install libraries with C:\Users\XXXX\Desktop>pip install gevent, it returns the following:

Could not import runpy module
ModuleNotFoundError: No module named 'runpy'

Running this also returns the same error C:\Users\XXXX\Desktop>pip:

Could not import runpy module
ModuleNotFoundError: No module named 'runpy'

I have searched endlessly for this error and none of them have helped me. I have tried searching for the runpy module but could not find it nor its location.

Hope someone can help

like image 298
Pablo H Avatar asked Jul 18 '18 14:07

Pablo H


2 Answers

Runpy is installed by default with your environment.

If you are using virtualenv, deleting and creating another one should fix the problem.

If you are trying to install globally, try to re-install Python and/or checking the PATH in windows environment variables.

like image 72
Gabriel Panza Avatar answered Nov 09 '22 05:11

Gabriel Panza


Delete the Virtual environment folder under the C: driver User path named as Envs. Then search the virtual keyword in the search tab and delete all the Python virtual environment packages and folders. Finally, reinstall the Python Note - Install Python 64bit for the 64bit machine. Hope You will get some idea from it.

like image 28
Madhan Kumar Selvaraj Avatar answered Nov 09 '22 05:11

Madhan Kumar Selvaraj