Error when installing XLRD using pip for python (3.6)

6.3k views Asked by At

I am using windows 10 64-bit and i installed pip as well as python using the python installer. When i type the command pip install xlrd the following error appears :

C:\Users\Tanmay>pip install xlrd
Collecting xlrd
  Downloading xlrd-1.0.0-py3-none-any.whl (143kB)
    100% |████████████████████████████████| 153kB 317kB/s
Installing collected packages: xlrd
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\install.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)\\python36-32\\Lib\\site-packages\\xlrd'
2

There are 2 answers

0
Tanmay Bhatnagar On BEST ANSWER

The problem got fixed simply by running the command prompt as an administrator.

1
mohamed.alsum On

it gives you Permission Error try to install it as super user sudo pip install xlrd

in case of windows, in cmd try to run pip install using python executable

e.g.

`python -m pip install xlrd`