gpt4 book ai didi

python-3.x - 如何为python3安装omniORB?

转载 作者:行者123 更新时间:2023-12-05 07:33:38 31 4
gpt4 key购买 nike

只需执行配置脚本,我就可以让 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/python3

没有为 python3 做这个技巧:

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。

最佳答案

我也遇到了同样的问题(我使用的是 ubuntu 18.04 和 omniORB 4.2.3)。

在我的例子中,omniORBpy 安装在/usr/local/lib/python3.6/site-packages 中,但该目录不在 python 的 sys.path 中。

您应该检查 sys.path 以及 omniORBpy 的安装位置。

关于python-3.x - 如何为python3安装omniORB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50481236/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com