尝试使用pip安装pandas时权限被拒绝

时间:2015-12-08 14:59:00

标签: python windows pandas permissions pip

我正在尝试使用pip:

从Windows命令行安装Python pandas软件包
pip install pandas

但我得到以下错误。我还从这里https://pypi.python.org/pypi/pandas/0.17.0/#downloads下载了轮版本,并尝试了这一点:

pip install pandas-0.17.1-cp35-none-win_amd64.whl

在任何一种情况下,我都会收到此错误:

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'

我还尝试以管理员身份打开cmd,但仍然遇到同样的错误。

与此同时,我能够使用pip安装numpy库。

3 个答案:

答案 0 :(得分:3)

我在尝试在azure上安装pandas时遇到了类似的问题。

以下工作:

python -m pip install --user pandas

答案 1 :(得分:0)

即使以管理员身份运行cmd,我也遇到了同样的问题。我重新启动电脑并再次以管理员身份运行cmd并且工作正常。

我试图通过Anaconda的Windows应用程序安装记录,获得相同的权限错误。

答案 2 :(得分:0)

对于现在发现的任何人:

此网站对我来说非常理想。可悲的是,我不得不使用内置的命令提示符,但是它可以完成工作: https://data-flair.training/blogs/install-pandas-on-windows/