Pycharm找不到扩展库

时间:2015-01-08 14:09:10

标签: c++ ipython pycharm

我创建了一个python c ++扩展模块ext_py,它依赖于两个底层共享库

ext_py.so(boost.python扩展模块,定义要向python公开的函数)和extensions.so(纯c ++扩展)。我在LD_LIBRARY_PATH中指定了它们的位置。 如果我在命令行上运行ipython,我可以毫无问题地导入ext_py,一切都按预期运行。如果我尝试使用ipython控制台在PyCharm(社区版)中做同样的事情,我会得到

In[2]: import ext_py
Traceback (most recent call last):
  File ".../lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2883, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-fa927ffef473>", line 1, in <module>
    import ext_py
  File "/opt/jetbrains/pycharm-community-4.0.2/helpers/pydev/pydev_import_hook.py", line   21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File ".../lib/python2.7/site-packages/ext_py/__init__.py", line 1, in <module>
    from ext_py import *
  File "/opt/jetbrains/pycharm-community-4.0.2/helpers/pydev/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: extensions.so: cannot open shared object file: No such file or directory

因此,由于某些原因,PyCharm无法找到这些变量,即使它在终端中有效。我确实在终端中指定了LD_LIBRARY_PATH,但我希望这会在全局范围内被选中。

有什么想法吗?

干杯,迈克

0 个答案:

没有答案