Closed wreckdump closed 3 years ago
This could be caused by the too-outdated _geoslib.c
file in src
. You could try to go to this line of the setup file and replace _geoslib.c
with _geoslib.pyx
. This way Python should generate the GEOS C file at build time.
Thank you for your reply. I did what you have suggested, and I got the following error message.
ERROR: Command errored out with exit status 1:
command: /home/rangke/py_vrt/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/rangke/testsite/basemap/setup.py'"'"'; __file__='"'"'/home/rangke/testsite/basemap/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /home/rangke/testsite/basemap/
Complete output (49 lines):
running develop
running build_scripts
running egg_info
running build_src
build_src
building extension "_geoslib" sources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/rangke/testsite/basemap/setup.py", line 130, in <module>
setup(
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/home/rangke/py_vrt/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/rangke/py_vrt/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/develop.py", line 15, in install_for_development
old_develop.install_for_development(self)
File "/home/rangke/py_vrt/lib/python3.9/site-packages/setuptools/command/develop.py", line 132, in install_for_development
self.run_command('egg_info')
File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/egg_info.py", line 24, in run
self.run_command("build_src")
File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/build_src.py", line 144, in run
self.build_sources()
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/build_src.py", line 161, in build_sources
self.build_extension_sources(ext)
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
sources, py_files = self.filter_py_files(sources)
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/build_src.py", line 391, in filter_py_files
return self.filter_files(sources, ['.py'])
File "/home/rangke/py_vrt/lib/python3.9/site-packages/numpy/distutils/command/build_src.py", line 400, in filter_files
(base, ext) = os.path.splitext(source)
File "/usr/lib/python3.9/posixpath.py", line 118, in splitext
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not list
----------------------------------------
ERROR: Command errored out with exit status 1: /home/rangke/py_vrt/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/rangke/testsite/basemap/setup.py'"'"'; __file__='"'"'/home/rangke/testsite/basemap/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Can you provide me the following information so that I can try to reproduce the problem?
Can you provide me the following information so that I can try to reproduce the problem?
* Operating System. * Python version (I guess 3.9 from the logs). * NumPy version. * Cython version.
OS : Arch Linux (kernel 5.14.12) Python : 3.9.7 Numpy : 1.12.3 Cython 0.29.24
I do not find any NumPy 1.12.3 in PyPI, do you refer to 1.21.3 (the latest available at the moment)?
I do not find any NumPy 1.12.3 in PyPI, do you refer to 1.21.3 (the latest available at the moment)?
Yeah, sorry that was a typo. Version 1.21.3 is correct.
Thanks for the confirmation. Now I could reach the same point as you in a Docker container, I am getting the same error. Give me some time to find out what is going wrong.
As fast workaround:
_geoslib.c
reference.src/_geoslib.c
(or move it e.g. to src/_geoslib.c.bak
).src
and run cythonize _geoslib.pyx
. This will create you the new _geoslib.c
file.basemap
top-level folder and now create the wheel (python setup.py bdist_wheel
), which will be stored in dist
. If the bdist_wheel
command is not recognised, run first pip install wheel
.basemap
wheel file with pip install dist/basemap-1.2.2+dev-cp39-cp39-linux_x86_64.whl
.It worked! Thank you! What was the problem? Was it the _geoslib.c
being too outdated?
Yes, it was the same problem as in #518, the setup script really needs some improvement.
Ah.. thanks!
I know this python module is deprecated, but I really like this module and I would like to keep using it... So, if someone can help me with this issue, I would really appreciate it.
I've recently updated my system and the whole python virtual environment broke. So, I am in the process of reinstalling all the modules that I frequently use, and I am having problem with installing the basemap.
I do have all the dependency installed, and the last step is to install the basemap. But, I am getting an error that I can not figure out. Below is the error message from the command
Error message