New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command "python setup.py egg_info" failed with error code 1 #1
Comments
Hello Zachary, Thanks for raise this issue. Unfortunately, I was unable to reproduce the it on Windows and the package was not tested on Linux. The successful installation of pydriosm requires a few other packages as dependencies, including 'psycopg2'. According to the error message you posted above, I can see there might be a problem in installing 'psycopg2'. You may want to make sure all the dependencies can also be successfully installed. Windows uses may encounter problems with only python-Levenshtein, Fiona, GDAL or Shapely. I'm not sure what would happen on Linux. Please also have a look at this: https://stackoverflow.com/questions/11583714/install-psycopg2-on-ubuntu. Hope it can do some help. If you still have a problem with the installation, do post it up here. I'd be happy to help. |
Will do, thanks! |
After running Collecting gdal==2.4.1 (from pydriosm)
ERROR: Could not find a version that satisfies the requirement gdal==2.4.1 (from pydriosm) (from versions: 1.5.0, 1.5.2, 1.6.0, 1.6.1, 1.7.0, 1.7.1, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.11.0, 1.11.1, 1.11.2, 2.0.0, 2.0.1, 2.1.0, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.2, 3.0.0, 3.0.1)
ERROR: No matching distribution found for gdal==2.4.1 (from pydriosm) Any ideas? |
One of the package dependencies, Fiona, requires GDAL 2.4.x. When writing the package, the .whl file of GDAL 2.4.1 was used. However, I just noticed that the version 2.4.1 cannot be found in PyPI now but only 2.4.0 and 2.4.2 are available. I suppose one possible way to solve the problem in your case is to download the .tar.gz file and install the specific version directly. But I've also made some modifications to the source code and released a new version (now v1.0.16), which allows the installation of "GDAL>=2.4,<3". Hope it should work properly. Can you try and see if you can successfully install the package? |
Unfortunately installing The following (verbose) error messages are as follows: Building wheel for GDAL (setup.py) ... error`ERROR: Complete output from command /opt/conda/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-42lw56kb/GDAL/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-t36p1_8o --python-tag cp36: ERROR: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying gdal.py -> build/lib.linux-x86_64-3.6 copying ogr.py -> build/lib.linux-x86_64-3.6 copying osr.py -> build/lib.linux-x86_64-3.6 copying gdalconst.py -> build/lib.linux-x86_64-3.6 copying gdalnumeric.py -> build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/osgeo copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/gdal.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/gnm.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/osr.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo 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/gdalnumeric.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/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/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py Skipping optional fixer: ws_comma 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/gdalnumeric.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/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/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py Skipping optional fixer: ws_comma running build_ext gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/opt/conda/include/python3.6m -I/opt/conda/lib/python3.6/site-packages/numpy/core/include -I/usr/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o building 'osgeo._gdal' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/extensions gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/opt/conda/include/python3.6m -I/opt/conda/lib/python3.6/site-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o -I/usr/include/gdal cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ extensions/gdal_wrap.cpp:4073:1: error: ‘VSIDIR’ does not name a type; did you mean ‘S_IFDIR’? VSIDIR* wrapper_VSIOpenDir( const char * utf8_path, ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:4121:38: error: ‘VSIDIR’ was not declared in this scope DirEntry* wrapper_VSIGetNextDirEntry(VSIDIR* dir) ^~~~~~ extensions/gdal_wrap.cpp:4121:38: note: suggested alternative: ‘S_IFDIR’ DirEntry* wrapper_VSIGetNextDirEntry(VSIDIR* dir) ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:4121:46: error: ‘dir’ was not declared in this scope DirEntry* wrapper_VSIGetNextDirEntry(VSIDIR* dir) ^~~ extensions/gdal_wrap.cpp:4121:46: note: suggested alternative: ‘div’ DirEntry* wrapper_VSIGetNextDirEntry(VSIDIR* dir) ^~~ div extensions/gdal_wrap.cpp: In function ‘bool wrapper_VSISync(const char*, const char*, char**, GDALProgressFunc, void*)’: extensions/gdal_wrap.cpp:4170:12: error: ‘VSISync’ was not declared in this scope return VSISync( pszSource, pszTarget, options, callback, callback_data, nullptr ); ^~~~~~~ extensions/gdal_wrap.cpp:4170:12: note: suggested alternative: ‘VSIStat’ return VSISync( pszSource, pszTarget, options, callback, callback_data, nullptr ); ^~~~~~~ VSIStat extensions/gdal_wrap.cpp: In function ‘retStringAndCPLFree* wrapper_VSIGetSignedURL(const char*, char**)’: extensions/gdal_wrap.cpp:4176:12: error: ‘VSIGetSignedURL’ was not declared in this scope return VSIGetSignedURL( utf8_path, options ); ^~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:4176:12: note: suggested alternative: ‘VSIRewindL’ return VSIGetSignedURL( utf8_path, options ); ^~~~~~~~~~~~~~~ VSIRewindL extensions/gdal_wrap.cpp: At global scope: extensions/gdal_wrap.cpp:5759:98: error: ‘GDALRATTableType’ has not been declared SWIGINTERN void GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow *self,GDALRATTableType eTableType){ ^~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp: In function ‘void GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow*, int)’: extensions/gdal_wrap.cpp:5760:9: error: ‘GDALRATSetTableType’ was not declared in this scope GDALRATSetTableType( self, eTableType ); ^~~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:5760:9: note: suggested alternative: ‘GDALRATFieldType’ GDALRATSetTableType( self, eTableType ); ^~~~~~~~~~~~~~~~~~~ GDALRATFieldType extensions/gdal_wrap.cpp: At global scope: extensions/gdal_wrap.cpp:5762:12: error: ‘GDALRATTableType’ does not name a type; did you mean ‘GDALRATFieldType’? SWIGINTERN GDALRATTableType GDALRasterAttributeTableShadow_GetTableType(GDALRasterAttributeTableShadow *self){ ^~~~~~~~~~~~~~~~ GDALRATFieldType extensions/gdal_wrap.cpp: In function ‘int ContourGenerateEx(GDALRasterBandShadow*, OGRLayerShadow*, char**, GDALProgressFunc, void*)’: extensions/gdal_wrap.cpp:6053:13: error: ‘GDALContourGenerateEx’ was not declared in this scope eErr = GDALContourGenerateEx( srcBand, ^~~~~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:6053:13: note: suggested alternative: ‘GDALContourGenerate’ eErr = GDALContourGenerateEx( srcBand, ^~~~~~~~~~~~~~~~~~~~~ GDALContourGenerate extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetErrorCounter(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:8017:14: error: ‘CPLGetErrorCounter’ was not declared in this scope result = CPLGetErrorCounter(); ^~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:8017:14: note: suggested alternative: ‘_wrap_GetErrorCounter’ result = CPLGetErrorCounter(); ^~~~~~~~~~~~~~~~~~ _wrap_GetErrorCounter extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_OpenDir(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:8468:3: error: ‘VSIDIR’ was not declared in this scope VSIDIR *result = 0 ; ^~~~~~ extensions/gdal_wrap.cpp:8468:3: note: suggested alternative: ‘S_IFDIR’ VSIDIR *result = 0 ; ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:8468:11: error: ‘result’ was not declared in this scope VSIDIR *result = 0 ; ^~~~~~ extensions/gdal_wrap.cpp:8468:11: note: suggested alternative: ‘resultobj’ VSIDIR *result = 0 ; ^~~~~~ resultobj extensions/gdal_wrap.cpp:8554:25: error: expected primary-expression before ‘)’ token result = (VSIDIR *)wrapper_VSIOpenDir((char const *)arg1,arg2,arg3); ^ extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetNextDirEntry(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:8973:3: error: ‘VSIDIR’ was not declared in this scope VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~~~ extensions/gdal_wrap.cpp:8973:3: note: suggested alternative: ‘S_IFDIR’ VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:8973:11: error: ‘arg1’ was not declared in this scope VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~ extensions/gdal_wrap.cpp:8973:11: note: suggested alternative: ‘args’ VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~ args extensions/gdal_wrap.cpp:8973:27: error: expected primary-expression before ‘)’ token VSIDIR *arg1 = (VSIDIR *) 0 ; ^ extensions/gdal_wrap.cpp:8984:28: error: ‘VSIDIR’ does not name a type; did you mean ‘S_IFDIR’? arg1 = reinterpret_cast< VSIDIR * >(argp1); ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:8984:35: error: expected ‘>’ before ‘*’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:8984:35: error: expected ‘(’ before ‘*’ token extensions/gdal_wrap.cpp:8984:37: error: expected primary-expression before ‘>’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:8984:45: error: expected ‘)’ before ‘;’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:8996:59: error: ‘wrapper_VSIGetNextDirEntry’ cannot be used as a function result = (DirEntry *)wrapper_VSIGetNextDirEntry(arg1); ^ extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_CloseDir(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:9018:3: error: ‘VSIDIR’ was not declared in this scope VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~~~ extensions/gdal_wrap.cpp:9018:3: note: suggested alternative: ‘S_IFDIR’ VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:9018:11: error: ‘arg1’ was not declared in this scope VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~ extensions/gdal_wrap.cpp:9018:11: note: suggested alternative: ‘args’ VSIDIR *arg1 = (VSIDIR *) 0 ; ^~~~ args extensions/gdal_wrap.cpp:9018:27: error: expected primary-expression before ‘)’ token VSIDIR *arg1 = (VSIDIR *) 0 ; ^ extensions/gdal_wrap.cpp:9028:28: error: ‘VSIDIR’ does not name a type; did you mean ‘S_IFDIR’? arg1 = reinterpret_cast< VSIDIR * >(argp1); ^~~~~~ S_IFDIR extensions/gdal_wrap.cpp:9028:35: error: expected ‘>’ before ‘*’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:9028:35: error: expected ‘(’ before ‘*’ token extensions/gdal_wrap.cpp:9028:37: error: expected primary-expression before ‘>’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:9028:45: error: expected ‘)’ before ‘;’ token arg1 = reinterpret_cast< VSIDIR * >(argp1); ^ extensions/gdal_wrap.cpp:9040:7: error: ‘VSICloseDir’ was not declared in this scope VSICloseDir(arg1); ^~~~~~~~~~~ extensions/gdal_wrap.cpp:9040:7: note: suggested alternative: ‘VSIFCloseL’ VSICloseDir(arg1); ^~~~~~~~~~~ VSIFCloseL extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MkdirRecursive(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:9754:16: error: ‘VSIMkdirRecursive’ was not declared in this scope result = VSIMkdirRecursive((char const *)arg1,arg2); ^~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:9754:16: note: suggested alternative: ‘VSIReadDirRecursive’ result = VSIMkdirRecursive((char const *)arg1,arg2); ^~~~~~~~~~~~~~~~~ VSIReadDirRecursive extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_RmdirRecursive(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:9824:16: error: ‘VSIRmdirRecursive’ was not declared in this scope result = VSIRmdirRecursive((char const *)arg1); ^~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:9824:16: note: suggested alternative: ‘VSIReadDirRecursive’ result = VSIRmdirRecursive((char const *)arg1); ^~~~~~~~~~~~~~~~~ VSIReadDirRecursive extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetActualURL(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:10206:24: error: ‘VSIGetActualURL’ was not declared in this scope result = (char *)VSIGetActualURL((char const *)arg1); ^~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:10206:24: note: suggested alternative: ‘_wrap_GetActualURL’ result = (char *)VSIGetActualURL((char const *)arg1); ^~~~~~~~~~~~~~~ _wrap_GetActualURL extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemsPrefixes(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:10380:25: error: ‘VSIGetFileSystemsPrefixes’ was not declared in this scope result = (char **)VSIGetFileSystemsPrefixes(); ^~~~~~~~~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:10380:25: note: suggested alternative: ‘_wrap_GetFileSystemsPrefixes’ result = (char **)VSIGetFileSystemsPrefixes(); ^~~~~~~~~~~~~~~~~~~~~~~~~ _wrap_GetFileSystemsPrefixes extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemOptions(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:10444:24: error: ‘VSIGetFileSystemOptions’ was not declared in this scope result = (char *)VSIGetFileSystemOptions((char const *)arg1); ^~~~~~~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:10444:24: note: suggested alternative: ‘_wrap_GetFileSystemOptions’ result = (char *)VSIGetFileSystemOptions((char const *)arg1); ^~~~~~~~~~~~~~~~~~~~~~~ _wrap_GetFileSystemOptions extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_VSICurlPartialClearCache(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:11639:7: error: ‘VSICurlPartialClearCache’ was not declared in this scope VSICurlPartialClearCache((char const *)arg1); ^~~~~~~~~~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:11639:7: note: suggested alternative: ‘_wrap_VSICurlPartialClearCache’ VSICurlPartialClearCache((char const *)arg1); ^~~~~~~~~~~~~~~~~~~~~~~~ _wrap_VSICurlPartialClearCache extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_RasterAttributeTable_SetTableType(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:25920:3: error: ‘GDALRATTableType’ was not declared in this scope GDALRATTableType arg2 ; ^~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:25920:3: note: suggested alternative: ‘GDALRATFieldType’ GDALRATTableType arg2 ; ^~~~~~~~~~~~~~~~ GDALRATFieldType extensions/gdal_wrap.cpp:25938:3: error: ‘arg2’ was not declared in this scope arg2 = static_cast< GDALRATTableType >(val2); ^~~~ extensions/gdal_wrap.cpp:25938:3: note: suggested alternative: ‘arg1’ arg2 = static_cast< GDALRATTableType >(val2); ^~~~ arg1 extensions/gdal_wrap.cpp:25938:23: error: ‘GDALRATTableType’ does not name a type; did you mean ‘GDALRATFieldType’? arg2 = static_cast< GDALRATTableType >(val2); ^~~~~~~~~~~~~~~~ GDALRATFieldType extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_RasterAttributeTable_GetTableType(PyObject*, PyObject*)’: extensions/gdal_wrap.cpp:25971:3: error: ‘GDALRATTableType’ was not declared in this scope GDALRATTableType result; ^~~~~~~~~~~~~~~~ extensions/gdal_wrap.cpp:25971:3: note: suggested alternative: ‘GDALRATFieldType’ GDALRATTableType result; ^~~~~~~~~~~~~~~~ GDALRATFieldType extensions/gdal_wrap.cpp:25985:7: error: ‘result’ was not declared in this scope result = (GDALRATTableType)GDALRasterAttributeTableShadow_GetTableType(arg1); ^~~~~~ extensions/gdal_wrap.cpp:25985:7: note: suggested alternative: ‘res1’ result = (GDALRATTableType)GDALRasterAttributeTableShadow_GetTableType(arg1); ^~~~~~ res1 extensions/gdal_wrap.cpp:25997:48: error: ‘result’ was not declared in this scope resultobj = SWIG_From_int(static_cast< int >(result)); ^~~~~~ extensions/gdal_wrap.cpp:25997:48: note: suggested alternative: ‘res1’ resultobj = SWIG_From_int(static_cast< int >(result)); ^~~~~~ res1 error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for GDAL` And then: Running setup.py install for GDAL ... error
Thanks for taking the time to look into this, I appreciate it |
Hi @manesioz A colleague of mine just kindly helped figure out what the problem was and installed the latest version of pydriosm successfully on a Linux system (Ubuntu 18.04.3 LTS). And the package works well in that environment. If you are still interested in trying out this package, you could go through the following steps to get around the issue with the installation of the GDAL Python library (>=2.4, <3.0).
A little bit more (perhaps you won't need this, but just in case): If an error occurs on psycopg2 library, try to install psycopg2-binary instead separately:
If there is still an error on GDAL, try: (not sure about this)
I think this is all we could do for now. If you see this and are able to complete the installation, please let me know. |
@mikeqfu Awesome, it works! Thank you so much :) Fantastic library. |
Hi @mikeqfu
I tried to change it to 2.4.2 but in this case pydriosm cannot been installed |
Hi @petudan, Can you try again with GDAL 3.0.3 (or above)? I guess that should work. |
Hi @mikeqfu. I tried but it doesn't work either :( |
I am in Centos 7 Linux, I tried the next:
for me, it run succesfully |
I am unable to install your package.
I ran
python3 -m pip install --upgrade pydriosm
and got the following:Any help would be greatly appreciated, this seems like an excellent library!
Edit: I am running this on a Linux machine (Ubuntu 18.04.3 LTS)
The text was updated successfully, but these errors were encountered: