Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Pip安装带有osx gdal绑定的pygdal失败_Python_Pip_Virtualenv_Gdal - Fatal编程技术网

Python Pip安装带有osx gdal绑定的pygdal失败

Python Pip安装带有osx gdal绑定的pygdal失败,python,pip,virtualenv,gdal,Python,Pip,Virtualenv,Gdal,我试图在OSX Mojave(10.14.5)上运行geoDjango项目。 因此,我已经按照Django文档中的建议安装了依赖项(也尝试了brew软件包) 创建了我的虚拟电视,显示 New python executable in /Users/ts/.virtualenvs/project_upstream/bin/python2.7 Also creating executable in /Users/ts/.virtualenvs/project_upstream/bin/python

我试图在OSX Mojave(10.14.5)上运行geoDjango项目。 因此,我已经按照Django文档中的建议安装了依赖项(也尝试了brew软件包)

创建了我的虚拟电视,显示

New python executable in /Users/ts/.virtualenvs/project_upstream/bin/python2.7
Also creating executable in /Users/ts/.virtualenvs/project_upstream/bin/python
检查扁桃体

$ gdal-config --version
2.4.1
并尝试使用以下内容安装pygdal:

pip install pygdal==2.4.1.*
这与

        ERROR: Complete output from command /Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-2.7
    creating build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/gnm.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/__init__.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/gdalnumeric.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/osr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/gdal.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/ogr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/gdal_array.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    copying osgeo/gdalconst.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
    running build_ext
    clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
    clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o -std=c++11
    building 'osgeo._gdal' extension
    creating build/temp.macosx-10.14-x86_64-2.7
    creating build/temp.macosx-10.14-x86_64-2.7/extensions
    clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -std=c++11 -I/Library/Frameworks/GDAL.framework/Versions/2.4/Headers
    In file included from extensions/gdal_wrap.cpp:173:
    In file included from /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:88:
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register PyObject *obj,     /* Object */
        ^~~~~~~~~
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register PyObject *obj      /* Object */
        ^~~~~~~~~
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register const wchar_t *w,  /* wchar_t buffer */
        ^~~~~~~~~
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register wchar_t *w,        /* wchar_t buffer */
        ^~~~~~~~~
    In file included from extensions/gdal_wrap.cpp:173:
    In file included from /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:97:
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register PyObject *obj,     /* string or Unicode object */
        ^~~~~~~~~
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register char **s,          /* pointer to buffer variable */
        ^~~~~~~~~
    /usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register Py_ssize_t *len    /* pointer to length variable or NULL
        ^~~~~~~~~
    7 warnings generated.
    clang++ -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -L/Library/Frameworks/GDAL.framework/Versions/2.4/lib -lgdal -o build/lib.macosx-10.14-x86_64-2.7/osgeo/_gdal.so
    ld: warning: directory not found for option '-L/Library/Frameworks/GDAL.framework/Versions/2.4/lib'
    ld: library not found for -lgdal
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang++' failed with exit status 1
    ----------------------------------------
ERROR: Command "/Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal" failed with error code 1 in /private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/
为了解决这个问题,我删除了所有软件包并重新安装。进一步尝试了brew和kynchaos的不同软件包,并在中找到了说明,但没有成功

奇怪的是,我可以使用NoVirtualEnv毫无问题地安装pygdal


你知道如何克服这个错误吗?原因可能是什么?

问题是通过重新安装virtualenv解决的

问题是通过重新安装virtualenv解决的