example.pyファイルには次のものがあります。
import libnet
しかし、私がそれを実行するとき:
/opt/local/bin/python2.5 example.py
「ImportError:libnetという名前のモジュールがありません」というメッセージが表示されます
インストールしようとした方法:
- http://pylibnet.sourceforge.net/にアクセスしてダウンロードしました
- READMEファイルを読んでください:Macでのコンパイルは機能しません。MacportsでロードしてPython2.5を使用してください。
- インストールして使用したPython2.5
- 次の方法でlibnetをインストールしました:sudo port install libnet11
- すべてがうまくいくようです
エラーが残っているだけで、インストールされていないようです。私は今何ができますか?
どんな種類の助けにも感謝します!
/編集:
と: "sudo /opt/local/bin/python2.5 setup.py install"、私は得ています:
Searching for libnet...
running install
running build
running build_ext
building 'libnet' extension
/Developer/usr/bin/llvm-gcc-4.2 -fno-strict-aliasing -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DLIBNET_MAJOR_VERSION=1 -DLIBNET_MINOR_VERSION=1 -DLIBNET_RELEASE=5 -DMAJOR_VERSION=2 -DMINOR_VERSION=0 -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/libnetmodule.c -o build/temp.macosx-10.7-x86_64-2.5/src/libnetmodule.o
In file included from src/context.c:110,
from src/libnetmodule.c:37:
src/builders.c: In function 'context_build_icmpv4_timestamp':
src/builders.c:726: error: 'n_time' undeclared (first use in this function)
src/builders.c:726: error: (Each undeclared identifier is reported only once
src/builders.c:726: error: for each function it appears in.)
src/builders.c:726: error: expected ';' before 'otime'
src/builders.c:727: error: expected ';' before 'rtime'
src/builders.c:728: error: expected ';' before 'ttime'
src/builders.c:735: error: 'otime' undeclared (first use in this function)
src/builders.c:735: error: 'rtime' undeclared (first use in this function)
src/builders.c:735: error: 'ttime' undeclared (first use in this function)
error: command '/Developer/usr/bin/llvm-gcc-4.2' failed with exit status 1