Python Cモジュールを起動して実行しようとして立ち往生しています。Hereから deltaLDA モジュールをインストールしています。REAMDE ファイルで指定されている指示に従いました。いつものように、私は次のように書きました。
sudo python setup.py install
すべてが期待どおりに進んだと思います。次の出力が得られます。
running build
running build_ext
building 'deltaLDA' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
creating build
creating build/temp.linux-i686-2.7
compile options: '-I/media/Hub/DropBox/Dropbox/Betazeta/Software/LDA/deltaLDA -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c'
extra options: '-O3 -Wall'
gcc: deltaLDA.c
In file included from /usr/include/python2.7/Python.h:8:0,
from deltaLDA.c:22:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
deltaLDA.c:686:1: warning: function declaration isn’t a prototype
creating build/lib.linux-i686-2.7
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/deltaLDA.o -o build/lib.linux-i686-2.7/deltaLDA.so
running install_lib
copying build/lib.linux-i686-2.7/deltaLDA.so -> /usr/local/lib/python2.7/dist-packages
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/deltaLDA-0.1.1.egg-info
Writing /usr/local/lib/python2.7/dist-packages/deltaLDA-0.1.1.egg-info
しかし、deltaLDA モジュールをインポートしようとすると、次のエラーが発生します。
>>> from deltaLDA import deltaLDA
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named deltaLDA
インストールされているモジュールを help('modules') または pip freeze コマンドで確認すると、両方のリストで deltaLDA を見つけることができますが、インポートできません。助けていただければ幸いです。
ありがとう!
更新:
sys.path も確認しましたが、その'/usr/local/lib/python2.7/dist-packages'
上にあります。* を deltaLDA からインポートしようとするとfrom deltaLDA import *
、同じエラーが発生します。インタープリターでもdir(deltaLDA)
同じ「モジュール名なし」エラーを取得しようとしました。deltaLDA モジュールに問題があるのではないでしょうか? 誰かがそれをインストールしようとすることができますか?
修理済み
dist-packages の .so ファイルと Egg-info ファイルのパーミッションを確認しました。それらは読めませんでした。理由はわかりません。sudo chmod 777 ファイルを実行したところ、動作するようになりました!.