libnlopt.so.0は共有オブジェクトファイルを開くことができません。

libnlopt.so.0は共有オブジェクトファイルを開くことができません。

このエラーはどういう意味ですか?

ImportError: libnlopt.so.0: cannot open shared object file: No such file or directory

Python2を実行しようとしています。スクリプトこれにはnloptが必要です。

nloptは次のようにインストールされました。

pip2 install --user nlopt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting nlopt
  Using cached https://files.pythonhosted.org/packages/7f/4f/de7e64a295e86c9f1ee382076019e0526247969353eb29345da1a05854b6/nlopt-2.4.2.post2.tar.gz
Requirement already satisfied: numpy in /usr/lib/python2.7/dist-packages (from nlopt) (1.13.3)
Installing collected packages: nlopt
  Running setup.py install for nlopt ... done
Successfully installed nlopt-2.4.2.post2
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

ベストアンサー1

これは、共有ライブラリをロードできないことを意味します。次の手順で問題を解決できます。

sudo apt-get install libnlopt0

その後、コマンドを実行します。

つまり、Debian/Ubuntu または派生製品を実行する場合です。それ以外の場合は、ディストリビューションでパッケージを追加するために使用するコマンドを使用します(この場合は)libnlopt0

おすすめ記事