Anaconda install pyipopt: libipopt.so.1

大憨熊 提交于 2021-02-11 15:52:07

问题


I'm completely new to Python and most aspects of compiling C.

My default python interpreter is the anaconda interpreter for python 2.7. I'm trying to install pyipopt following these instructions: https://github.com/xuy/pyipopt. Pyipopt installed to /usr/local/lib/python2.7/dist-packages/pyipopt, but when I try import pyipopt I get an error saying that pyipopt wasn't found.

I then tried copying the installed folder into Anaconda's pkgs folder. At first it said Error: import pyipopt ImportError: can not find libipopt.so.1, but then it went back to saying that pyipopt wasn't found after I logged out and back in.

I then tried copying the installed folder into {anaconda_dir}/lib/python2.7/site-packages, but it again said Error: import pyipopt ImportError: can not find libipopt.so.1. The troubleshooting section on the github page says to copy libipopt.so.1 into a folder accessible to ld, but I'm not really sure which folder would fit the bill.

Could someone give a brief explanation or link on how python finds C libraries or other .so libraries? Thanks.


回答1:


The guide you've provided guides the user to install using sudo. When one does that, the packaged is installed in the system. And since you are using python from Anaconda and not from the system, Anaconda cannot find pyipopt, since it is not on its path.

I suggest that you try installing using:

$ python setup.py build
$ python setup.py install

Note that I removed the sudo.

Regarding the libipopt.so.1 library, maybe this answer from @alk can help you.



来源:https://stackoverflow.com/questions/39557960/anaconda-install-pyipopt-libipopt-so-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!