[英]Permission denied when trying to install pandas with pip
I am trying to install the Python pandas package from the Windows command line with pip:我正在尝试使用 pip 从 Windows 命令行安装 Python pandas 包:
pip install pandas
but I get the following errror.但我收到以下错误。 I also downloaded the wheel version from here https://pypi.python.org/pypi/pandas/0.17.0/#downloads and tried that as well:
我还从这里下载了轮子版本https://pypi.python.org/pypi/pandas/0.17.0/#downloads并尝试过:
pip install pandas-0.17.1-cp35-none-win_amd64.whl
In either case, I get this error:在任何一种情况下,我都会收到此错误:
Exception:
Traceback (most recent call last):
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2795, in _dep_map
return self.__dep_map
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2652, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2786, in _parsed_pkg_info
return self._pkg_info
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2652, in __getattr__
raise AttributeError(attr)
AttributeError: _pkg_info
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\commands\install.py", line 294, in run
requirement_set.prepare_files(finder)
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\req\req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\req\req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\req\req_set.py", line 561, in _prepare_file
set(req_to_install.extras) - set(dist.extras)
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2774, in extras
return [dep for dep in self._dep_map if dep]
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2797, in _dep_map
self.__dep_map = self._compute_dependencies()
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2819, in _compute_dependencies
for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 2788, in _parsed_pkg_info
metadata = self.get_metadata(self.PKG_INFO)
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 1616, in get_metadata
return self._get(self._fn(self.egg_info, name)).decode("utf-8")
File "c:\users\adi\appdata\local\programs\python\python35\lib\site-packages\pi
p\_vendor\pkg_resources\__init__.py", line 1722, in _get
with open(path, 'rb') as stream:
PermissionError: [Errno 13] Permission denied: 'c:\\users\\adi\\appdata\\local\\
temp\\pip-build-3ge1gj75\\pandas\\pandas-0.17.0.dist-info\\METADATA'
I also tried to open cmd
as administrator, but still got the same error.我也尝试以管理员身份打开
cmd
,但仍然出现相同的错误。
Meanwhile, I was able to install the numpy library using pip.同时,我能够使用 pip 安装 numpy 库。
I faced a similar problem trying to install pandas on azure.我在尝试在 azure 上安装 Pandas 时遇到了类似的问题。
The following worked:以下工作:
python -m pip install --user pandas
I was having the same problem even running cmd as administrator.即使以管理员身份运行 cmd 我也遇到了同样的问题。 I re-start the pc and run the cmd as administrator again and it worked.
我重新启动电脑并再次以管理员身份运行 cmd 并且它起作用了。
For the record I tried to install though the Anaconda's Windows app, obtaining the same permission error.作为记录,我尝试通过 Anaconda 的 Windows 应用程序进行安装,但获得了相同的权限错误。
FOR ANYONE FINDING THIS NOW:对于现在发现这个的任何人:
This website worked perfectly for me.这个网站非常适合我。 Sadly, I had to use the built-in command prompt, but it gets the job done: https://data-flair.training/blogs/install-pandas-on-windows/
可悲的是,我不得不使用内置的命令提示符,但它完成了工作: https : //data-flair.training/blogs/install-pandas-on-windows/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.