只需执行配置脚本,我就可以让omniORB在python2.7中运行。
ubuntu@ubuntu:/usr/local/bin$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ubuntu@ubuntu:/usr/local/bin$ python2
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import omniORB
>>> 但是,运行
../configure PYTHON=/usr/bin/python3Python3没有做到这一点:
ubuntu@ubuntu:/usr/local/bin$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omniORB
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'omniORB'
>>> 在不带任何选项的情况下运行../configure时,该脚本输出:
...
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
...运行../configure PYTHON=/usr/bin/python3时,该脚本输出:
...
checking for python version... 3.5
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.5/site-packages
...我使用的是ubuntu 16.04和最新的omniorb 4.2.2。
发布于 2019-11-03 15:49:39
我也遇到了同样的问题(我使用的是ubuntu18.04和omniORB 4.2.3)。
在我的例子中,omniORBpy安装在/usr/local/lib/python3.6/site-packages中,但该目录不在python的sys.path中。
您应该检查sys.path和omniORBpy的安装位置。
https://stackoverflow.com/questions/50481236
复制相似问题