Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

python 2.7 - Anaconda install pyipopt: libipopt.so.1

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...