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

Docker image does not build (Apple M1) #34

Closed
val-ismaili opened this issue Jan 16, 2023 · 2 comments
Closed

Docker image does not build (Apple M1) #34

val-ismaili opened this issue Jan 16, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@val-ismaili
Copy link
Contributor

val-ismaili commented Jan 16, 2023

On building a docker image on an Apple M1 machine with:
docker build -t "osmox" .

when executing this line in the dockerfile I get the error:

`× python setup.py egg_info did not run successfully.
#10 2.642   │ exit code: 1
#10 2.642   ╰─> [12 lines of output]
#10 2.642       Failed `CDLL(libgeos_c.so.1)`
#10 2.642       Failed `CDLL(libgeos_c.so)`
#10 2.642       Traceback (most recent call last):
#10 2.642         File "<string>", line 36, in <module>
#10 2.642         File "<pip-setuptools-caller>", line 34, in <module>
#10 2.642         File "/tmp/pip-install-w53lhwgs/shapely_248fa231557d464fa86b92b4ff842582/setup.py", line 74, in <module>
#10 2.642           from shapely._buildcfg import geos_version_string, geos_version, \
#10 2.642         File "/tmp/pip-install-w53lhwgs/shapely_248fa231557d464fa86b92b4ff842582/shapely/_buildcfg.py", line 167, in <module>
#10 2.642           fallbacks=['libgeos_c.so.1', 'libgeos_c.so'])
#10 2.642         File "/tmp/pip-install-w53lhwgs/shapely_248fa231557d464fa86b92b4ff842582/shapely/_buildcfg.py", line 161, in load_dll
#10 2.642           libname, fallbacks or []))
#10 2.642       OSError: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']
#10 2.642       [end of output]
#10 2.642   
#10 2.642   note: This error originates from a subprocess, and is likely not a problem with pip.
#10 2.643 error: metadata-generation-failed`
@val-ismaili
Copy link
Contributor Author

val-ismaili commented Jan 16, 2023

Docker image will build if add the below to dockerfile:

apt-get -y install libgeos-dev &&  \
apt-get -y install libgdal-dev &&  \
apt-get -y install build-essential cmake libboost-dev libexpat1-dev zlib1g-dev libbz2-dev &&  \

However when running osmox in a container a shapely error occurs:

Loading config from '/mnt/new_d/example.json'.
Configured OSM tag keys: ['building', 'highway', 'public_transport']
Configured activities: ['education', 'home', 'medical', 'other', 'shop', 'transit', 'visit', 'work']
INFO:osmox.main: Filtering all objects found in /mnt/new_d/isle-of-man-latest.osm.pbf. This may take a long while.
ERROR:shapely.geos:ParseException: Invalid HEX char
Traceback (most recent call last):
  File "/usr/local/bin/osmox", line 33, in <module>
    sys.exit(load_entry_point('osmox', 'console_scripts', 'osmox')())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/osmox/main.py", line 71, in run
    handler.apply_file(str(input_path), locations=True, idx='flex_mem')
  File "/osmox/build.py", line 287, in node
    self.add_point(idx=n.id, activity_tags=activity_tags, geom=self.fab_point(n))
  File "/osmox/build.py", line 268, in fab_point
    return wkblib.loads(wkb, hex=True)
  File "/usr/local/lib/python3.7/site-packages/shapely/wkb.py", line 21, in loads
    return reader.read_hex(data)
  File "/usr/local/lib/python3.7/site-packages/shapely/geos.py", line 443, in read_hex
    "Could not create geometry because of errors "
shapely.errors.WKBReadingError: Could not create geometry because of errors while reading input.

@val-ismaili val-ismaili added the bug Something isn't working label Jan 16, 2023
@val-ismaili val-ismaili changed the title Docker image on M1 Docker image does not build Jan 16, 2023
@val-ismaili val-ismaili changed the title Docker image does not build Docker image does not build (Apple M1) Jan 17, 2023
@brynpickering
Copy link
Contributor

With the new mamba install method, this has a workaround on Apple Silicon devices: arup-group/genet#221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants