Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error runpy.py
#1
Hi
I am getting the below error when tried to install any lib like urllib,urlib2,request etc
my OS is Windows:7 / 64 Bit

What could be the reason , can you guys help me ?

C:\Program Files\Python36\Scripts>pip install urllib
Error:
Traceback (most recent call last): File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_mai n "__main__", mod_spec) File "c:\program files\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files\Python36\Scripts\pip.exe\__main__.py", line 5, in <modu le> ImportError: cannot import name 'main'
Reply
#2
(Apr-16-2018, 12:14 PM)parthi1705 Wrote: What could be the reason , can you guys help me ?
Added code tag in your post,look at BBCode on how to use.

urllib is part of standard library ,so then no install.
Python 3.6 and pip installation under Windows
There you see how to install Requests and test that it work.
pip should work from anywhere in cmd,not just from Scripts folder.
cmd:
C:\>pip -V
pip 9.0.3 from c:\python36\lib\site-packages (python 3.6)

C:\>pip install -U requests
Requirement already up-to-date: requests in c:\python36\lib\site-packages
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in c:\python36\lib\site-packages (from requests)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in c:\python36\lib\site-packages (from requests)
Requirement already up-to-date: certifi>=2017.4.17 in c:\python36\lib\site-packages (from requests)
Requirement already up-to-date: idna<2.7,>=2.5 in c:\python36\lib\site-packages (from requests)

C:\>
Reply
#3
Thanks for your response, but still the same.

C:\>pip -v
Traceback (most recent call last):
File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_mai
n
"__main__", mod_spec)
File "c:\program files\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python36\Scripts\pip.exe\__main__.py", line 5, in <modu
le>
ImportError: cannot import name 'main'

Getting the same error which is mentioned in the link https://bugs.python.org/issue21030

but after issuing the below , same error

icacls path\to\site-packages\pip /inheritance:e /t
icacls path\to\site-packages\pip /reset /t
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020