-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
GDAL installation via pip exits with errors #2827
Comments
Likely a duplicate of #2166 . You need to have the GDAL development headers & library that match the version you install from pip |
I'd installed all these headers and libraries before as described here. Checking my GDAL-version installed via previously employing
Unfortunately, Next, I've tried Click here to open the error-log``` andylu@andylu-ThinkPad-Edge-E130:~/Desktop/Python/Scripts$ pip install pygdal Collecting pygdal Downloading pygdal-3.1.2.6.tar.gz (473 kB) |████████████████████████████████| 473 kB 1.7 MB/s Requirement already satisfied: numpy>=1.0.0 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from pygdal) (1.19.1) Building wheels for collected packages: pygdal Building wheel for pygdal (setup.py) ... error ERROR: Command errored out with exit status 1: command: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-__bvmq5c/pygdal/setup.py'"'"'; __file__='"'"'/tmp/pip-install-__bvmq5c/pygdal/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-fcnuu6k3 cwd: /tmp/pip-install-__bvmq5c/pygdal/ Complete output (48 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/osgeo copying osgeo/osr.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/ogr.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdal.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/__init__.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gnm.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.8/osgeo /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/lib2to3_ex.py:39: SetuptoolsDeprecationWarning: 2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process. warnings.warn( Fixing build/lib.linux-x86_64-3.8/osgeo/osr.py build/lib.linux-x86_64-3.8/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.8/osgeo/ogr.py build/lib.linux-x86_64-3.8/osgeo/gdal.py build/lib.linux-x86_64-3.8/osgeo/__init__.py build/lib.linux-x86_64-3.8/osgeo/gdalconst.py build/lib.linux-x86_64-3.8/osgeo/gnm.py build/lib.linux-x86_64-3.8/osgeo/gdal_array.py Skipping optional fixer: ws_comma Fixing build/lib.linux-x86_64-3.8/osgeo/osr.py build/lib.linux-x86_64-3.8/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.8/osgeo/ogr.py build/lib.linux-x86_64-3.8/osgeo/gdal.py build/lib.linux-x86_64-3.8/osgeo/__init__.py build/lib.linux-x86_64-3.8/osgeo/gdalconst.py build/lib.linux-x86_64-3.8/osgeo/gnm.py build/lib.linux-x86_64-3.8/osgeo/gdal_array.py Skipping optional fixer: ws_comma running build_ext Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-__bvmq5c/pygdal/setup.py", line 236, in setup( File "/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup return distutils.core.setup(**attrs) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 223, in run self.run_command('build') File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-__bvmq5c/pygdal/setup.py", line 83, in run raise GDALConfigError('Version mismatch %s != %s' % ( __main__.GDALConfigError: Version mismatch 2.2.3 != 3.1.2 ---------------------------------------- ERROR: Failed building wheel for pygdal Running setup.py clean for pygdal Failed to build pygdal DEPRECATION: Could not build wheels for pygdal which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. Installing collected packages: pygdal Running setup.py install for pygdal ... error ERROR: Command errored out with exit status 1: command: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-__bvmq5c/pygdal/setup.py'"'"'; __file__='"'"'/tmp/pip-install-__bvmq5c/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 /tmp/pip-record-vnj9juhe/install-record.txt --single-version-externally-managed --compile --install-headers /home/linuxbrew/.linuxbrew/include/python3.8/pygdal cwd: /tmp/pip-install-__bvmq5c/pygdal/ Complete output (50 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/osgeo copying osgeo/osr.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/ogr.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdal.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/__init__.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gnm.py -> build/lib.linux-x86_64-3.8/osgeo copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.8/osgeo /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/lib2to3_ex.py:39: SetuptoolsDeprecationWarning: 2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process. warnings.warn( Fixing build/lib.linux-x86_64-3.8/osgeo/osr.py build/lib.linux-x86_64-3.8/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.8/osgeo/ogr.py build/lib.linux-x86_64-3.8/osgeo/gdal.py build/lib.linux-x86_64-3.8/osgeo/__init__.py build/lib.linux-x86_64-3.8/osgeo/gdalconst.py build/lib.linux-x86_64-3.8/osgeo/gnm.py build/lib.linux-x86_64-3.8/osgeo/gdal_array.py Skipping optional fixer: ws_comma Fixing build/lib.linux-x86_64-3.8/osgeo/osr.py build/lib.linux-x86_64-3.8/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.8/osgeo/ogr.py build/lib.linux-x86_64-3.8/osgeo/gdal.py build/lib.linux-x86_64-3.8/osgeo/__init__.py build/lib.linux-x86_64-3.8/osgeo/gdalconst.py build/lib.linux-x86_64-3.8/osgeo/gnm.py build/lib.linux-x86_64-3.8/osgeo/gdal_array.py Skipping optional fixer: ws_comma running build_ext Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-__bvmq5c/pygdal/setup.py", line 236, in setup( File "/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup return distutils.core.setup(**attrs) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/command/install.py", line 545, in run self.run_command('build') File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-install-__bvmq5c/pygdal/setup.py", line 83, in run raise GDALConfigError('Version mismatch %s != %s' % ( __main__.GDALConfigError: Version mismatch 2.2.3 != 3.1.2 ---------------------------------------- ERROR: Command errored out with exit status 1: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-__bvmq5c/pygdal/setup.py'"'"'; __file__='"'"'/tmp/pip-install-__bvmq5c/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 /tmp/pip-record-vnj9juhe/install-record.txt --single-version-externally-managed --compile --install-headers /home/linuxbrew/.linuxbrew/include/python3.8/pygdal Check the logs for full command output. ``` Maybe, I'll have to install GDAL 3.1.2 for fixing this? On the other hand, it states that I've installed the latest version:
Otherwise, I don't know what else to do or what you could mean by saying
|
Pin the version of the bindings that match your native lib: |
Thanks, this worked indeed:
|
Testing if collapsible markdown works in comments. And it seems to work. Would you mind to have a try with your error message? I used https://gist.githubusercontent.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f/raw/f774f242feff6bae4a5be7d6c71aa5df2e3fcb0e/README.md as an example. CLICK ME FOR EXPANDING THE LOGlong long long log |
Thanks for this tip, I've implemented it with the very long error message above. |
I know this is an older thread. I'm curious why pip doesn't pick up the native version? |
Hi,
By design pip does not resolve non-Python requirements. It's out of scope
for the project.
…On Sun, May 1, 2022, 10:09 AM tom-flamelit ***@***.***> wrote:
I know this is an older thread. I'm curious why pip doesn't pick up the
native version?
—
Reply to this email directly, view it on GitHub
<#2827 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIHIMFDKOK4S4XAGBMNETVH2UCVANCNFSM4PTLSG2A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Perhaps a more informative error would help resolve -- as it stands the current error presented here is difficult to find a resolution for. Would something like "Could not find GDAL version aligned to requested version installed via pip. Please see ____" or similar be possible in the traceback? If you think that is reasonable I am happy to spend some time on it. |
https://www.youtube.com/watch?v=8iCWUp7WaTk |
how can i install gdal through pycharm in my project directory please give any suggestion |
I am using anaconda to do this. You first access you envirment by typing in "conda activate env-name". Then visit the site https://www.lfd.uci.edu/~gohlke/pythonlibs/, the index by date section will have the names of the libraries, find the one you need and click on it. Next it will pull up the versions available, they will be organized by python version, windows version and program version. Make sure you choose the correct one or it will throw and error. Once downloaded type in cd Downloads in anaconda and they type "python -m pip install {name of downloaded file}", finally go into your pycharm and confirm its good to go by typing "pip install {package}". |
try |
Expected behavior and actual behavior.
I wanted to install it via pip, but got the following console output:
The error output was:
Steps to reproduce the problem.
pip install gdal
Operating system
Lubuntu 18.04 64 bit
GDAL version and provenance
cached GDAL-3.1.2.tar.gz (593 kB) from pip
The text was updated successfully, but these errors were encountered: