Skip to content
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

Closed
manesioz opened this issue Oct 3, 2019 · 12 comments
Closed

Command "python setup.py egg_info" failed with error code 1 #1

manesioz opened this issue Oct 3, 2019 · 12 comments

Comments

@manesioz
Copy link

manesioz commented Oct 3, 2019

I am unable to install your package.

I ran python3 -m pip install --upgrade pydriosm and got the following:

ERROR: Complete output from command python setup.py egg_info:
    ERROR: running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.

    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-8v3gj_z2/psycopg2/

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)

@mikeqfu
Copy link
Owner

mikeqfu commented Oct 4, 2019

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.

@manesioz
Copy link
Author

manesioz commented Oct 4, 2019

Will do, thanks!

@manesioz
Copy link
Author

manesioz commented Oct 4, 2019

After running sudo apt-get install python3-psycopg2 (which worked fine) I tried again and got the following

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?

@mikeqfu
Copy link
Owner

mikeqfu commented Oct 6, 2019

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?

@manesioz
Copy link
Author

manesioz commented Oct 7, 2019

Unfortunately installing pydriosm==1.0.16 doesn't work either, it is unable to build GDAL.

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

ERROR: 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'"'"'))' install --record /tmp/pip-record-9mcrxyg1/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-42lw56kb/GDAL/\

Thanks for taking the time to look into this, I appreciate it

@mikeqfu
Copy link
Owner

mikeqfu commented Oct 7, 2019

I'm sorry that it didn't work. As before mentioned, an alternative way is to download, say 2.4.1 or 2.4.2), and install the .tar.gz file directly. If you just google "ubuntu build gdal from source", there should be plenty of guidance on how to install it.

@mikeqfu
Copy link
Owner

mikeqfu commented Oct 10, 2019

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).

  1. Remove all other versions of GDAL (if you have already installed any, say ver.2.2.3)

  2. Add the official stable UbuntuGIS packages to your system by running the following command (This provides a stable repository with gdal 2.4.0. You may also want to have a look at this page):

sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
  1. (Important) Then you should install "gdal-bin (== 2.4.0)":
sudo apt-get install gdal-bin=2.4.0+dfsg-1~bionic0
  1. Then you’ll need to install the GDAL development libraries "libgdal-dev" before installing the GDAL for Python:
sudo apt-get install libpq-dev
  1. After successful completion of the above, you should now be able to install pydriosm.
sudo python3 –m pip install pydriosm

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:

sudo python3 –m pip install psycopg2-binary

If there is still an error on GDAL, try: (not sure about this)

sudo apt-get install libgdal-bin

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.

@manesioz
Copy link
Author

manesioz commented Oct 11, 2019

@mikeqfu Awesome, it works! Thank you so much :) Fantastic library.

@petudan
Copy link

petudan commented Feb 23, 2020

Hi @mikeqfu
I tried to get described version of GDAL (2.4.0) but it says:

E: Version '2.4.0+dfsg-1~bionic0' for 'gdal-bin' was not found

I tried to change it to 2.4.2 but in this case pydriosm cannot been installed

@mikeqfu
Copy link
Owner

mikeqfu commented Feb 24, 2020

Hi @petudan, Can you try again with GDAL 3.0.3 (or above)? I guess that should work.

@petudan
Copy link

petudan commented Mar 1, 2020

Hi @mikeqfu. I tried but it doesn't work either :(

@Jonathan-GC
Copy link

I am in Centos 7 Linux, I tried the next:

  1. sudo yum install postgresql-libs
  2. sudo yum install postgresql-devel
  3. sudo pip install psycopg2

for me, it run succesfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants