简体   繁体   中英

error in installing request module in python 3.6

I am facing some errors and exceptions while installing requests module in python 3.6 version. I am attaching screenshot of the errors that i am facing. click here for error screenshot

here is the error that i got on cmd windows

C:\Program Files (x86)\Python36-32\Scripts>pip3 install requests
Collecting requests
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: certifi, urllib3, idna, chardet, requests
Exception:
Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py"
, line 215, in main
    status = self.run(options, args)
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\instal
l.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py"
, line 784, in install
    **kwargs
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install
.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install
.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line
 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line
 316, in clobber
    ensure_dir(destdir)
  File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.
py", line 83, in ensure_dir
    os.makedirs(path)
  File "c:\program files (x86)\python36-32\lib\os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python
36-32\\Lib\\site-packages\\certifi'

Thanks in advance

The issue that you are facing is because of a permission error. This is likely because you have not run the command line prompt as an administrator. So, the best thing to do is right click on the command line icon, and run as administrator. Once you've done that, continue normally and install requests using pip install requests . Normally, when you try to install python packages in the main python installation, this error occurs, because you need admin privileges in order to write to anything in Program Files.

That should solve the problem. However, what would be a better option would be to install the virtualenv package, and then have localized installation of packages, so that you can avoid these messy installations that require special rights.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM