1

我已经以管理员身份运行实例化了 osgeo4w,但它仍然给了我权限被拒绝。我正在尝试在 Quantum GIS 2.8 上安装 pandas,我已经使用 pip 命令安装了 sklearn,并且安装成功。

但是,当我尝试安装 pandas 时,会出现以下错误:

  C:\Windows\System32>pip install pandas
    Collecting pandas
    C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
      SNIMissingWarning
    C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
      InsecurePlatformWarning
      Using cached pandas-0.18.0-cp27-cp27m-win_amd64.whl
    Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in c:\progra~1\qgiswi~1\apps\python27\lib\site-packages\pytz-2012j-py2.7.egg (from pandas)
    Requirement already satisfied (use --upgrade to upgrade): python-dateutil in c:\osgeo4~1\apps\python27\lib\site-packages\python_dateutil-2.1-py2.7.egg (from pandas)
    Collecting numpy>=1.7.0 (from pandas)
      Using cached numpy-1.10.4-cp27-none-win_amd64.whl
    Requirement already satisfied (use --upgrade to upgrade): six in c:\osgeo4~1\apps\python27\lib\site-packages\six-1.3.0-py2.7.egg (from python-dateutil->pandas)
    Installing collected packages: numpy, pandas
Exception:
Traceback (most recent call last):
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\basecommand.py", line 209, in main
    status = self.run(options, args)
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\req\req_set.py", line 732, in install
    **kwargs
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\req\req_install.py", line 835, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\req\req_install.py", line 1030, in move_wheel_files
    isolated=self.isolated,
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\wheel.py", line 344, in move_wheel_files
    clobber(source, lib_dir, True)
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\site-packages\pip\wheel.py", line 322, in clobber
    shutil.copyfile(srcfile, destfile)
  File "C:\PROGRA~1\QGISWI~1\apps\Python27\lib\shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'C:\\PROGRA~1\\QGISWI~1\\apps\\Python27\\Lib\\site-packages\\numpy\\core\\multiarray.pyd'

有什么解决方案吗?

4

1 回答 1

0

万一有人(像我一样)发现这篇文章很有用......

将熊猫从 0.18 升级到 0.20 时,我遇到了同样的问题 pip install --upgrade pandas

问题:numpy 和 pandas 安装程序想要编写已经存在于 ../site-packages/numpy 和 ../site-packages/pandas 文件夹中的较新文件。

由于某种原因,shutil 无法以“wb”模式打开这些文件。

虽然numpy>=1.7.0满足了要求,但使用“--upgrade”也可以升级 numpy。

解决方案:

为了避免IO Error: [Errno 13] Permission denied: ...,卸载numpy和pandas,然后重新安装(首先是numpy):

    pip uninstall numpy
    pip install numpy
    pip uninstall pandas
    pip install pandas
于 2017-07-21T13:04:29.533 回答