Windows 7上的Python pip安装错误

时间:2015-02-06 15:25:56

标签: python python-2.7 pip

我是python的新手,我在Windows 7 x64机器上安装了Python 2.7.9和Setuptools。

当我尝试使用

安装GDAL包时
pip install gdal

在生成错误消息时,似乎一直运行到清理阶段。该消息意味着什么,以及如何解决它。

C:\Users\mem48>pip install gdal
Collecting gdal
  Using cached GDAL-1.11.1.tar.gz
Installing collected packages: gdal
  Running setup.py install for gdal
    building 'osgeo._gdal' extension
    C:\Users\mem48\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I../../port -I../../gco
re -I../../alg -I../../ogr/ -IC:\Python27\include -IC:\Python27\PC -I. /Tpextens
ions/gdal_wrap.cpp /Fobuild\temp.win32-2.7\Release\extensions/gdal_wrap.obj
    gdal_wrap.cpp
    C:\Users\mem48\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but un
wind semantics are not enabled. Specify /EHsc
    extensions/gdal_wrap.cpp(2855) : fatal error C1083: Cannot open include file
: 'cpl_port.h': No such file or directory
    error: command 'C:\\Users\\mem48\\AppData\\Local\\Programs\\Common\\Microsof
t\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
    Complete output from command C:\Python27\python.exe -c "import setuptools, t
okenize;__file__='c:\\users\\mem48\\appdata\\local\\temp\\pip-build-05tivk\\gdal
\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
e('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\mem48\appdata\loc
al\temp\pip-ilzyp9-record\install-record.txt --single-version-externally-managed
 --compile:
    running install

    running build

    running build_py

    creating build

    creating build\lib.win32-2.7

    copying gdal.py -> build\lib.win32-2.7

    copying ogr.py -> build\lib.win32-2.7

    copying osr.py -> build\lib.win32-2.7

    copying gdalconst.py -> build\lib.win32-2.7

    creating build\lib.win32-2.7\osgeo

    copying osgeo\gdal.py -> build\lib.win32-2.7\osgeo

    copying osgeo\gdalconst.py -> build\lib.win32-2.7\osgeo

    copying osgeo\gdalnumeric.py -> build\lib.win32-2.7\osgeo

    copying osgeo\gdal_array.py -> build\lib.win32-2.7\osgeo

    copying osgeo\ogr.py -> build\lib.win32-2.7\osgeo

    copying osgeo\osr.py -> build\lib.win32-2.7\osgeo

    copying osgeo\__init__.py -> build\lib.win32-2.7\osgeo

    running build_ext

    building 'osgeo._gdal' extension

    creating build\temp.win32-2.7

    creating build\temp.win32-2.7\Release

    creating build\temp.win32-2.7\Release\extensions

    C:\Users\mem48\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I../../port -I../../gco
re -I../../alg -I../../ogr/ -IC:\Python27\include -IC:\Python27\PC -I. /Tpextens
ions/gdal_wrap.cpp /Fobuild\temp.win32-2.7\Release\extensions/gdal_wrap.obj

    gdal_wrap.cpp

    C:\Users\mem48\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but un
wind semantics are not enabled. Specify /EHsc

    extensions/gdal_wrap.cpp(2855) : fatal error C1083: Cannot open include file
: 'cpl_port.h': No such file or directory

    error: command 'C:\\Users\\mem48\\AppData\\Local\\Programs\\Common\\Microsof
t\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

    ----------------------------------------
    Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:
\\users\\mem48\\appdata\\local\\temp\\pip-build-05tivk\\gdal\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\mem48\appdata\local\temp\pip-ilzyp9-r
ecord\install-record.txt --single-version-externally-managed --compile" failed w
ith error code 1 in c:\users\mem48\appdata\local\temp\pip-build-05tivk\gdal

0 个答案:

没有答案