Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...