TA-Lib的Python包装器:导入失败[更改路径无效]

0 投票
1 回答
666 浏览
提问于 2025-04-18 13:07

我已经安装了ta-lib,但设置路径并没有解决问题……

~$ export LD_LIBRARY_PATH=$usr/local/lib:$LD_LIBRARY_PATH
~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/xun/.python-eggs is            
writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a     
more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/talib/__init__.py", line 4, in <module>
File "build/bdist.linux-x86_64/egg/talib/common.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/talib/common.py", line 6, in __bootstrap__
ImportError: libta_lib.so.0: cannot open shared object file: No such file or directory

请帮帮我……

1 个回答

1

如果你已经安装了 libta_lib.so.0,我觉得你在设置路径的时候可能写错了。

export LD_LIBRARY_PATH=$usr/local/lib:$LD_LIBRARY_PATH 改成 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH 就可以了。

撰写回答