-
Notifications
You must be signed in to change notification settings - Fork 2
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
Problems installing according to instructions. #42
Comments
Thanks for opening this. I'm seeing similar errors related to GDAL when running > poetry install
...
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/usr/lib/python3/dist-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
self.run_setup()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "<string>", line 350, in <module>
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
self.run_command(cmd)
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 312, in run
self.find_sources()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
mm.run()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 543, in run
self.add_defaults()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 581, in add_defaults
sdist.add_defaults(self)
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/command/sdist.py", line 109, in add_defaults
super().add_defaults()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 239, in add_defaults
self._add_defaults_ext()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 323, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in get_finalized_command
cmd_obj.ensure_finalized()
File "/tmp/tmp1gpcbehm/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 124, in ensure_finalized
self.finalize_options()
File "<string>", line 255, in finalize_options
File "<string>", line 194, in get_gdal_config
gdal_config_error: Traceback (most recent call last):
File "<string>", line 87, in fetch_config
File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 188, in get_gdal_config
File "<string>", line 90, in fetch_config
gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'
Could not find gdal-config. Make sure you have installed the GDAL native library and development headers.
at /usr/lib/python3/dist-packages/poetry/installation/chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with gdal (3.6.3) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "gdal (==3.6.3)"'. GDAL is a system dependency that is not being installed by Python. I'll need to look into this more. |
Interesting that you dont get the "project.dependencies must be array" error. Maybe that is a new version of poetry that I have installed. I will try installing gdal independently via a downloaded wheel |
I installed GDAL on the new test machine: > sudo apt update && sudo apt install -y gdal-bin libgdal-dev From here, I'm able to install the development version of this package without any issues: > poetry install
Installing dependencies from lock file
Package operations: 2 installs, 0 updates, 0 removals
- Installing fiona (1.10b2)
- Installing gdal (3.6.3)
Installing the current project: fgdb-to-gpkg (0.3.2) At a minimum, GDAL system dependency details and installation instructions should be added to the README. I'll also need to research best practices for managing system dependencies in Python packages. @scaddenp could you please ensure that GDAL is installed on your machine and then try running |
Working on it, but I dont think it will deal with the poetry error |
Thank you for looking into the GDAL dependency. I agree about the poetry error. I was successful when testing with poetry 1.8.2, however, I'm seeing a similar error now after upgrading to poetry 2.0.1: > poetry install
The Poetry configuration is invalid:
- project.dependencies must be array I suspect the major version bump introduced breaking changes. Can you please confirm your poetry version? |
@scaddenp, after reviewing the poetry docs and 2.0 changelog, I've identified several API changes that will require refactoring. It may take me a couple of weeks to fully adapt this project to poetry 2.0. I've also been considering migrating to That said, I was able to install this package from PyPI after ensuring that GDAL was installed: > gdalinfo --version
GDAL 3.8.4, released 2024/02/08
> pipx install fgdb-to-gpkg
installed package fgdb-to-gpkg 0.3.2, installed using Python 3.12.3
These apps are now globally available
- fgdb-to-gpkg
done! ✨ 🌟 ✨
> fgdb-to-gpkg --help
usage: fgdb-to-gpkg [-h] [--overwrite] fgdb_path gpkg_path
Convert an Esri File GeoDatabase to a GeoPackage If you're not actively developing on this project, then I recommend installing from PyPI via pipx. However, if you'd prefer to install the development version, please downgrade poetry to <=1.8.5, try running |
Probably something to do with trying to do it on windows:
pip failed to build package: Some possibly relevant errors from pip install: In short, looks like trying to compile a gdal wheel. I will try an alternative approach to installing gdal, natively and into the python environment. It will have to be tomorrow though as other stuff screaming. |
I also tried downgrade to poetry and running the install. Errors: Could not find geos-config executable. Either append the path to geos-config to PATH or manually provide the include_dirs, library_dirs, libraries and other link args for compiling against a GEOS version >=3.5. This came up repeatedly as it tried to compile various components. Finally died while invoking c compiler: All this while building shapely. The c compiler comes unstuck trying to build a wheel. |
Thanks for providing these details. When installing from PyPI, it seems like When installing the development version, it seems like poetry is now complaining about a missing GEOS installation, which is a separate system dependency. I didn't explicitly install GEOS when testing on my fresh Ubuntu machine, so I'm not sure why you're seeing this. Happy to try and troubleshoot this further over the next few days though. |
gdal is potentially a complex mess because I already have a osgeow gdal version installed. But I just tried pip install gdal with fingers crossed and it worked. (ie looking for the shortcut). Hence 3.6.2 not 3.6.3 - so it is trying to build rather than use binary. I am playing about a versions here to see what happens. I can always uninstall GDAL completely off machine and do fresh GDAL install at 3.6.3 but was trying to sidestep that. |
Decided that I didn't have time to clean up my mess on Windows and switched to linux. Binaries are available (cgohike) for 3.6.2 and 3.6.4 but not 3.6.3. Want it for a linux container ultimately anyway. On windows, I can get by with just scripting and OGR2OGR. |
Checking out branch and trying to install with poetry, I get:
fgdb_to_gpkg-main>poetry install
The Poetry configuration is invalid:
Same error with pipx install --editable .
Just trying to install with pipx
pipx install fgdb-to-gpkg
Gets:
pip failed to build package:
gdal
Some possibly relevant errors from pip install:
error: subprocess-exited-with-error
extensions/gdalconst_wrap.c(2703): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
extensions/gnm_wrap.cpp(2820): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
extensions/ogr_wrap.cpp(2845): fatal error C1083: Cannot open include file: 'gdal.h': No such file or directory
extensions/gdal_wrap.cpp(2884): fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or directory
extensions/osr_wrap.cpp(2879): fatal error C1083: Cannot open include file: 'cpl_string.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\HostX86\x64\cl.exe' failed with exit code 2
ERROR: Failed to build installable wheels for some pyproject.toml based projects (gdal)
Error installing fgdb-to-gpkg.
The text was updated successfully, but these errors were encountered: