我正在尝试使用PyOsmium,但不会导入. python3 setup.py安装似乎完成得很好,但是当我导入osmium时出现错误:
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'
我不知道是什么原因造成的,这是我第一次手动安装C包装程序.我在同一目录中有*PyOsmium和libosmium目录.是否正在尝试导入C文件?
任何帮助将非常感激.
解决方法:
我有same problem.解决方案as provided by one of the maintainers非常简单:
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.
转到与您在其中编译的目录不同的目录,它应该可以工作;它为我做了.