3

I am trying to use PyOsmium but it will not import. python3 setup.py install appears to complete just fine but when I import osmium I get the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dylan/Downloads/osmium/osmium/__init__.py", line 1, in <module>
    from ._osmium import *
ImportError: No module named 'osmium._osmium'

I have no idea what's causing this and it's my first time manually installing a C++ wrapper. I have the top-level PyOsmium and libosmium directories in the same directory. Is it trying to import the C++ files?

Any help would be much appreciated.

scai
  • 20,297
  • 4
  • 56
  • 72
Whonut
  • 288
  • 2
  • 12

1 Answers1

3

I had the same problem. The solution, as provided by one of the maintainers, is very easy:

Are you in the pyosmium root directory while trying the import? Change the directory to somewhere else and try again. In the root directory the local osmium source directory takes precedence over your freshly installed version.

Change to a different directory from the one you compiled in and it should work; it did for me.

Alex
  • 778
  • 2
  • 12
  • 16