Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.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
在Heroku上安装GDAL Python绑定_Python_Heroku_Gdal - Fatal编程技术网

在Heroku上安装GDAL Python绑定

在Heroku上安装GDAL Python绑定,python,heroku,gdal,Python,Heroku,Gdal,我正在尝试制作一个heroku应用程序,它使用osgeo的GDAL python绑定。我试过好几件事,但都不管用 我无法在部署中安装GDAL python绑定。这些是我当前的构建包 test gerry的下一版本将使用: 1.heroku/python 2.heroku/nodejs 和my requirements.txt attrs==18.2.0 Click==7.0 click-plugins==1.0.4 cligj==0.5.0 cycler==0.10.0 decorator==4

我正在尝试制作一个heroku应用程序,它使用osgeo的GDAL python绑定。我试过好几件事,但都不管用

我无法在部署中安装GDAL python绑定。这些是我当前的构建包

test gerry的下一版本将使用: 1.heroku/python 2.heroku/nodejs

和my requirements.txt

attrs==18.2.0
Click==7.0
click-plugins==1.0.4
cligj==0.5.0
cycler==0.10.0
decorator==4.3.0
Fiona==1.8.4
matplotlib==3.0.2
munch==2.3.2
networkx==2.2
numpy==1.15.1
pandas==0.23.4
pyparsing==2.3.0
python-dateutil==2.7.5
pytz==2018.7
kiwisolver==1.0.1
Shapely==1.6.4.post2
six==1.12.0
scipy==1.1.0
geopandas==0.4.0
gerrychain==0.2.2
pyproj==1.9.5.1
将gdal==2.3.1添加到requirements.txt时失败

remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:        Collecting gdal==2.3.1 (from -r /tmp/build_11d41259c199f22382350ebd6af5e868/requirements.txt (line 23))
remote:          Downloading https://files.pythonhosted.org/packages/99/31/2e05c1be3196126fa04028aed51489f40ceea77e8361a80bc8b00fc463db/GDAL-2.3.1.tar.gz (557kB)
remote:        Installing collected packages: gdal
remote:          Running setup.py install for gdal: started
remote:            Running setup.py install for gdal: finished with status 'error'
remote:            Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m5dctdxu/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-tsr5btk3-record/install-record.txt --single-version-externally-managed --compile:
remote:            running install
remote:            running build
remote:            running build_py
remote:            creating build
remote:            creating build/lib.linux-x86_64-3.6
remote:            copying gdal.py -> build/lib.linux-x86_64-3.6
remote:            copying ogr.py -> build/lib.linux-x86_64-3.6
remote:            copying osr.py -> build/lib.linux-x86_64-3.6
remote:            copying gdalconst.py -> build/lib.linux-x86_64-3.6
remote:            copying gnm.py -> build/lib.linux-x86_64-3.6
remote:            copying gdalnumeric.py -> build/lib.linux-x86_64-3.6
remote:            creating build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/gnm.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/osr.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/gdal.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo
remote:            Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
remote:            Skipping optional fixer: ws_comma
remote:            Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
remote:            Skipping optional fixer: ws_comma
remote:            running build_ext
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/app/.heroku/python/include/python3.6m -I/app/.heroku/python/lib/python3.6/site-packages/numpy/core/include -I/app/.heroku/vendor/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
remote:            building 'osgeo._gdal' extension
remote:            creating build/temp.linux-x86_64-3.6
remote:            creating build/temp.linux-x86_64-3.6/extensions
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/app/.heroku/python/include/python3.6m -I/app/.heroku/python/lib/python3.6/site-packages/numpy/core/include -I/app/.heroku/vendor/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o -I/app/.heroku/vendor/include
remote:            extensions/gdal_wrap.cpp: In function ‘retStringAndCPLFree* wrapper_VSIGetSignedURL(const char*, char**)’:
remote:            extensions/gdal_wrap.cpp:4067:12: error: ‘VSIGetSignedURL’ was not declared in this scope
remote:                 return VSIGetSignedURL( utf8_path, options );
remote:                        ^~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:4067:12: note: suggested alternative: ‘VSIRewindL’
remote:                 return VSIGetSignedURL( utf8_path, options );
remote:                        ^~~~~~~~~~~~~~~
remote:                        VSIRewindL
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetErrorCounter(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:7465:14: error: ‘CPLGetErrorCounter’ was not declared in this scope
remote:                 result = CPLGetErrorCounter();
remote:                          ^~~~~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:7465:14: note: suggested alternative: ‘_wrap_GetErrorCounter’
remote:                 result = CPLGetErrorCounter();
remote:                          ^~~~~~~~~~~~~~~~~~
remote:                          _wrap_GetErrorCounter
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MkdirRecursive(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:8553:16: error: ‘VSIMkdirRecursive’ was not declared in this scope
remote:                   result = VSIMkdirRecursive((char const *)arg1,arg2);
remote:                            ^~~~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:8553:16: note: suggested alternative: ‘VSIReadDirRecursive’
remote:                   result = VSIMkdirRecursive((char const *)arg1,arg2);
remote:                            ^~~~~~~~~~~~~~~~~
remote:                            VSIReadDirRecursive
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_RmdirRecursive(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:8623:16: error: ‘VSIRmdirRecursive’ was not declared in this scope
remote:                   result = VSIRmdirRecursive((char const *)arg1);
remote:                            ^~~~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:8623:16: note: suggested alternative: ‘VSIReadDirRecursive’
remote:                   result = VSIRmdirRecursive((char const *)arg1);
remote:                            ^~~~~~~~~~~~~~~~~
remote:                            VSIReadDirRecursive
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetActualURL(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:8788:24: error: ‘VSIGetActualURL’ was not declared in this scope
remote:                   result = (char *)VSIGetActualURL((char const *)arg1);
remote:                                    ^~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:8788:24: note: suggested alternative: ‘_wrap_GetActualURL’
remote:                   result = (char *)VSIGetActualURL((char const *)arg1);
remote:                                    ^~~~~~~~~~~~~~~
remote:                                    _wrap_GetActualURL
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemsPrefixes(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:8962:25: error: ‘VSIGetFileSystemsPrefixes’ was not declared in this scope
remote:                   result = (char **)VSIGetFileSystemsPrefixes();
remote:                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:8962:25: note: suggested alternative: ‘_wrap_GetFileSystemsPrefixes’
remote:                   result = (char **)VSIGetFileSystemsPrefixes();
remote:                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
remote:                                     _wrap_GetFileSystemsPrefixes
remote:            extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemOptions(PyObject*, PyObject*)’:
remote:            extensions/gdal_wrap.cpp:9026:24: error: ‘VSIGetFileSystemOptions’ was not declared in this scope
remote:                   result = (char *)VSIGetFileSystemOptions((char const *)arg1);
remote:                                    ^~~~~~~~~~~~~~~~~~~~~~~
remote:            extensions/gdal_wrap.cpp:9026:24: note: suggested alternative: ‘_wrap_GetFileSystemOptions’
remote:                   result = (char *)VSIGetFileSystemOptions((char const *)arg1);
remote:                                    ^~~~~~~~~~~~~~~~~~~~~~~
remote:                                    _wrap_GetFileSystemOptions
remote:            error: command 'gcc' failed with exit status 1
remote:            
remote:            ----------------------------------------
remote:        Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m5dctdxu/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-tsr5btk3-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-m5dctdxu/gdal/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to test-gerry.
remote:
我将config var BUILD_设置为_GEO_LIBRARIES=1,它将正确构建,但当我尝试在python控制台中导入osgeo时,它并不存在

我研究了如何使用构建包,但没有找到一个包含python绑定的构建包


如何在heroku上获得GDAL python绑定?

这里也有同样的问题!你解决了吗,@belmer1416?@thclark我联系了heroku开发团队,他们确认不支持。这是很久以前的事了,所以可能已经改变了。谢谢@belmer1416。这里也是一样,我想我必须找到一个解决方法或者做一个定制的构建包。有什么解决方案吗?我会联系开发团队,检查他们是否解决了这个问题,否则我会考虑使用另一个平台。例如使用AWS。