Ubuntu 10.04 中的 Boost.Python 教程
我下载了最新版本的 Boost,并尝试在 Ubuntu 10.04 上启动并运行 Boost.python 教程: http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/ python/hello.html
我导航到正确的目录,运行“bjam”并使用默认设置进行编译。我还没有创建 bjam 配置文件。编译似乎已经成功,但现在我不知道如何将这些文件包含在我的 python 脚本中。当我尝试运行 python hello world 脚本时,它给了我这个错误:
Traceback (most recent call last):
File "./hello.py", line 6, in <module>
import hello_ext
ImportError: libboost_python.so.1.43.0: cannot open shared object file: No such file or directory
有人知道发生了什么吗?
I downloaded the latest version of Boost and I'm trying to get the Boost.python tutorial up and running on Ubuntu 10.04: http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/hello.html
I navigated to the correct directory, ran "bjam" and it compiled using default settings. I did not yet create a bjam config file. The compilation appears to have worked, but now I have no idea how to include the files in my python script. When I try to run the python hello world script, it gives me this error:
Traceback (most recent call last):
File "./hello.py", line 6, in <module>
import hello_ext
ImportError: libboost_python.so.1.43.0: cannot open shared object file: No such file or directory
Anyone know what is going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你是如何安装boost的?
假设您使用以下内容: http://www.boost.org/doc/libs/1_43_0/more/getting_started/unix-variants.html#easy-build-and-install
liboost_python 分片库将安装在 /usr/local 中/lib
要运行 hello.py 示例,请尝试以下操作:
How did you install boost ?
Assuming you have use the following: http://www.boost.org/doc/libs/1_43_0/more/getting_started/unix-variants.html#easy-build-and-install
liboost_python shard library will be install in /usr/local/lib
To run the hello.py example, try the following:
我没有使用 Boost Python 库的经验,但正如错误所述,它无法找到 libboost_python 共享对象。
这里有几个选项(可能还有更多):
export LD_LIBRARY_PATH=/path_to_so/
。I have no experience with the the Boost Python libraries but as the error states, it is unable to find the libboost_python shared object.
You have several options here (there may be more):
export LD_LIBRARY_PATH=/path_to_so/
before execution.你安装了boost吗?仅编译它不足以将库安装到运行程序所需的位置。
Did you install boost? Just compiling it isn't sufficient to install the libraries where they need to be to run programs.