我按照安装python的keplerian工具箱的说明进行了操作,一切都很顺利但是在尝试导入模块时出现了问题。
我遵循的说明:keptoolbox
有谁知道如何解决这个问题?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/PyKEP/__init__.py", line 1, in <module>
import core, sims_flanagan
File "/usr/local/lib/python2.7/dist-packages/PyKEP/core/__init__.py", line 2, in <module>
from _core import *
ImportError: libkeplerian_toolbox.so: cannot open shared object file: No such file or directory
文件libkeplerian_toolbox.so
位于/usr/local/lib/libkeplerian_toolbox.so
。我需要复制到其他地方吗?
所有东西都安装在正确的目录中:
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libkeplerian_toolbox.so
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/core/_core.so
-- Removed runtime path from "/usr/local/lib/python2.7/dist-packages/PyKEP/core/_core.so"
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/core/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/sims_flanagan/_sims_flanagan.so
-- Removed runtime path from "/usr/local/lib/python2.7/dist-packages/PyKEP/sims_flanagan/_sims_flanagan.so"
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/sims_flanagan/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/orbit_plots/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/orbit_plots/_plots.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/_ex1.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/_ex2.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/_ex3.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/_ex4.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/examples/_ex5.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/interplanetary/__init__.py
-- Installing: /usr/local/lib/python2.7/dist-packages/PyKEP/interplanetary/_mga_1dsm.py
答案 0 :(得分:2)
这是一个链接问题,ldconfig
默认情况下不会查看/usr/local/lib
,因此您需要将其添加到文件/etc/ld.so.conf
(只需将其放在include语句下)。
现在运行
ldconfig
并且错误应该消失。