如何在 windows 7 上使用 cygwin 正确安装 NS-3 模拟器
How to install NS-3 simulator correctly using cygwin on windows 7
我需要 运行 在我的 windows 7 上安装 NS-3 模拟器,所以我安装了 cygwin 和 devel、python 和 utils 包。我在 运行 ./build.py
命令如下时遇到问题:
Traceback (most recent call last):
File "./build.py", line 10, in <module>
from util import run_command, fatal, CommandError
File "/home/user-PC/ns-allinone-3.25/util.py", line 3, in <module>
import subprocess
File "/usr/lib/python2.7/subprocess.py", line 430, in <module>
import pickle
File "/usr/lib/python2.7/pickle.py", line 1266, in <module>
import binascii as _binascii
ImportError: No such file or directory
请注意,我将目录更改为包含 build.py 文件和 {system root}/cygwin/home/user-PC
目录中 ns-3 其他文件的目录。
在我的 ns-3.25 文件夹中,我有以下文件:
AUTHORS、doc、Makefile、scratch、testpy.supp、VERSION、waf-tools 绑定、示例、README、src、utils、waf、wscript CHANGES.html、LICENSE、RELEASE_NOTES , test.py, utils.py, waf.bat, wutils.py.
虽然在这个版本的 ns-3 的主文件夹中,我有以下包括 ns-3.25 的文件夹:
烘焙,constants.pyc,pybindgen-0.17.0.post49+ng0e4e3bc,util.pyc,
build.py、netanim-3.107、自述文件、constants.py、ns-3.25、util.py。
我试过这个命令 python -v build.py |& tee build.log
并得到以下结果:
user@user-PC /home/user-PC/ns-allinone-3.25
$ python -v build.py |& tee build.log
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
import site # precompiled from /usr/lib/python2.7/site.pyc
# /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
import os # precompiled from /usr/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
import posixpath # precompiled from /usr/lib/python2.7/posixpath.pyc
# /usr/lib/python2.7/stat.pyc matches /usr/lib/python2.7/stat.py
import stat # precompiled from /usr/lib/python2.7/stat.pyc
# /usr/lib/python2.7/genericpath.pyc matches /usr/lib/python2.7/genericpath.py
import genericpath # precompiled from /usr/lib/python2.7/genericpath.pyc
# /usr/lib/python2.7/warnings.pyc matches /usr/lib/python2.7/warnings.py
import warnings # precompiled from /usr/lib/python2.7/warnings.pyc
# /usr/lib/python2.7/linecache.pyc matches /usr/lib/python2.7/linecache.py
import linecache # precompiled from /usr/lib/python2.7/linecache.pyc
# /usr/lib/python2.7/types.pyc matches /usr/lib/python2.7/types.py
import types # precompiled from /usr/lib/python2.7/types.pyc
# /usr/lib/python2.7/UserDict.pyc matches /usr/lib/python2.7/UserDict.py
import UserDict # precompiled from /usr/lib/python2.7/UserDict.pyc
# /usr/lib/python2.7/_abcoll.pyc matches /usr/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.7/_abcoll.pyc
# /usr/lib/python2.7/abc.pyc matches /usr/lib/python2.7/abc.py
import abc # precompiled from /usr/lib/python2.7/abc.pyc
# /usr/lib/python2.7/_weakrefset.pyc matches /usr/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/lib/python2.7/copy_reg.pyc matches /usr/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.7/copy_reg.pyc
# /usr/lib/python2.7/traceback.pyc matches /usr/lib/python2.7/traceback.py
import traceback # precompiled from /usr/lib/python2.7/traceback.pyc
# /usr/lib/python2.7/sysconfig.pyc matches /usr/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/lib/python2.7/sysconfig.pyc
# /usr/lib/python2.7/re.pyc matches /usr/lib/python2.7/re.py
import re # precompiled from /usr/lib/python2.7/re.pyc
# /usr/lib/python2.7/sre_compile.pyc matches /usr/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.7/sre_parse.pyc matches /usr/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.7/sre_parse.pyc
# /usr/lib/python2.7/sre_constants.pyc matches /usr/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.7/sre_constants.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_locale.dll", 2);
import _locale # dynamically loaded from /usr/lib/python2.7/lib-dynload/_locale.dll
# /usr/lib/python2.7/_sysconfigdata.pyc matches /usr/lib/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from /usr/lib/python2.7/_sysconfigdata.pyc
# zipimport: found 90 names in /usr/lib/python2.7/site-packages/paramiko-1.16.0-py2.7.egg
# zipimport: found 29 names in /usr/lib/python2.7/site-packages/ecdsa-0.13-py2.7.egg
import encodings # directory /usr/lib/python2.7/encodings
# /usr/lib/python2.7/encodings/__init__.pyc matches /usr/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.7/encodings/__init__.pyc
# /usr/lib/python2.7/codecs.pyc matches /usr/lib/python2.7/codecs.py
import codecs # precompiled from /usr/lib/python2.7/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.7/encodings/aliases.pyc matches /usr/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.7/encodings/aliases.pyc
# /usr/lib/python2.7/encodings/utf_8.pyc matches /usr/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.7/encodings/utf_8.pyc
Python 2.7.10 (default, Jun 1 2015, 18:05:38)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
# /usr/lib/python2.7/__future__.pyc matches /usr/lib/python2.7/__future__.py
import __future__ # precompiled from /usr/lib/python2.7/__future__.pyc
# /usr/lib/python2.7/optparse.pyc matches /usr/lib/python2.7/optparse.py
import optparse # precompiled from /usr/lib/python2.7/optparse.pyc
# /usr/lib/python2.7/textwrap.pyc matches /usr/lib/python2.7/textwrap.py
import textwrap # precompiled from /usr/lib/python2.7/textwrap.pyc
# /usr/lib/python2.7/string.pyc matches /usr/lib/python2.7/string.py
import string # precompiled from /usr/lib/python2.7/string.pyc
dlopen("/usr/lib/python2.7/lib-dynload/strop.dll", 2);
import strop # dynamically loaded from /usr/lib/python2.7/lib-dynload/strop.dll
# /usr/lib/python2.7/gettext.pyc matches /usr/lib/python2.7/gettext.py
import gettext # precompiled from /usr/lib/python2.7/gettext.pyc
# /usr/lib/python2.7/locale.pyc matches /usr/lib/python2.7/locale.py
import locale # precompiled from /usr/lib/python2.7/locale.pyc
dlopen("/usr/lib/python2.7/lib-dynload/operator.dll", 2);
import operator # dynamically loaded from /usr/lib/python2.7/lib-dynload/operator.dll
# /usr/lib/python2.7/functools.pyc matches /usr/lib/python2.7/functools.py
import functools # precompiled from /usr/lib/python2.7/functools.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_functools.dll", 2);
import _functools # dynamically loaded from /usr/lib/python2.7/lib-dynload/_functools.dll
# /usr/lib/python2.7/copy.pyc matches /usr/lib/python2.7/copy.py
import copy # precompiled from /usr/lib/python2.7/copy.pyc
# /usr/lib/python2.7/weakref.pyc matches /usr/lib/python2.7/weakref.py
import weakref # precompiled from /usr/lib/python2.7/weakref.pyc
# /usr/lib/python2.7/struct.pyc matches /usr/lib/python2.7/struct.py
import struct # precompiled from /usr/lib/python2.7/struct.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_struct.dll", 2);
import _struct # dynamically loaded from /usr/lib/python2.7/lib-dynload/_struct.dll
import xml # directory /usr/lib/python2.7/xml
# /usr/lib/python2.7/xml/__init__.pyc matches /usr/lib/python2.7/xml/__init__.py
import xml # precompiled from /usr/lib/python2.7/xml/__init__.pyc
import xml.dom # directory /usr/lib/python2.7/xml/dom
# /usr/lib/python2.7/xml/dom/__init__.pyc matches /usr/lib/python2.7/xml/dom/__init__.py
import xml.dom # precompiled from /usr/lib/python2.7/xml/dom/__init__.pyc
# /usr/lib/python2.7/xml/dom/domreg.pyc matches /usr/lib/python2.7/xml/dom/domreg.py
import xml.dom.domreg # precompiled from /usr/lib/python2.7/xml/dom/domreg.pyc
# /usr/lib/python2.7/xml/dom/minicompat.pyc matches /usr/lib/python2.7/xml/dom/minicompat.py
import xml.dom.minicompat # precompiled from /usr/lib/python2.7/xml/dom/minicompat.pyc
# /usr/lib/python2.7/xml/dom/minidom.pyc matches /usr/lib/python2.7/xml/dom/minidom.py
import xml.dom.minidom # precompiled from /usr/lib/python2.7/xml/dom/minidom.pyc
# /usr/lib/python2.7/xml/dom/xmlbuilder.pyc matches /usr/lib/python2.7/xml/dom/xmlbuilder.py
import xml.dom.xmlbuilder # precompiled from /usr/lib/python2.7/xml/dom/xmlbuilder.pyc
# /usr/lib/python2.7/xml/dom/NodeFilter.pyc matches /usr/lib/python2.7/xml/dom/NodeFilter.py
import xml.dom.NodeFilter # precompiled from /usr/lib/python2.7/xml/dom/NodeFilter.pyc
# /usr/lib/python2.7/shlex.pyc matches /usr/lib/python2.7/shlex.py
import shlex # precompiled from /usr/lib/python2.7/shlex.pyc
# /usr/lib/python2.7/collections.pyc matches /usr/lib/python2.7/collections.py
import collections # precompiled from /usr/lib/python2.7/collections.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_collections.dll", 2);
import _collections # dynamically loaded from /usr/lib/python2.7/lib-dynload/_collections.dll
# /usr/lib/python2.7/keyword.pyc matches /usr/lib/python2.7/keyword.py
import keyword # precompiled from /usr/lib/python2.7/keyword.pyc
# /usr/lib/python2.7/heapq.pyc matches /usr/lib/python2.7/heapq.py
import heapq # precompiled from /usr/lib/python2.7/heapq.pyc
dlopen("/usr/lib/python2.7/lib-dynload/itertools.dll", 2);
import itertools # dynamically loaded from /usr/lib/python2.7/lib-dynload/itertools.dll
dlopen("/usr/lib/python2.7/lib-dynload/_heapq.dll", 2);
import _heapq # dynamically loaded from /usr/lib/python2.7/lib-dynload/_heapq.dll
import thread # builtin
dlopen("/usr/lib/python2.7/lib-dynload/cStringIO.dll", 2);
import cStringIO # dynamically loaded from /usr/lib/python2.7/lib-dynload/cStringIO.dll
# /home/user-PC/ns-allinone-3.25/constants.pyc matches /home/user-PC/ns-allinone-3.25/constants.py
import constants # precompiled from /home/user-PC/ns-allinone-3.25/constants.pyc
# /home/user-PC/ns-allinone-3.25/util.pyc matches /home/user-PC/ns-allinone-3.25/util.py
import util # precompiled from /home/user-PC/ns-allinone-3.25/util.pyc
# /usr/lib/python2.7/subprocess.pyc matches /usr/lib/python2.7/subprocess.py
import subprocess # precompiled from /usr/lib/python2.7/subprocess.pyc
import gc # builtin
dlopen("/usr/lib/python2.7/lib-dynload/time.dll", 2);
import time # dynamically loaded from /usr/lib/python2.7/lib-dynload/time.dll
dlopen("/usr/lib/python2.7/lib-dynload/select.dll", 2);
import select # dynamically loaded from /usr/lib/python2.7/lib-dynload/select.dll
dlopen("/usr/lib/python2.7/lib-dynload/fcntl.dll", 2);
import fcntl # dynamically loaded from /usr/lib/python2.7/lib-dynload/fcntl.dll
# /usr/lib/python2.7/pickle.pyc matches /usr/lib/python2.7/pickle.py
import pickle # precompiled from /usr/lib/python2.7/pickle.pyc
import marshal # builtin
dlopen("/usr/lib/python2.7/lib-dynload/binascii.dll", 2);
Traceback (most recent call last):
File "build.py", line 10, in <module>
from util import run_command, fatal, CommandError
File "/home/user-PC/ns-allinone-3.25/util.py", line 3, in <module>
import subprocess
File "/usr/lib/python2.7/subprocess.py", line 430, in <module>
import pickle
File "/usr/lib/python2.7/pickle.py", line 1266, in <module>
import binascii as _binascii
ImportError: No such file or directory
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] cStringIO
# cleanup[1] __future__
# cleanup[1] site
# cleanup[1] sysconfig
# cleanup[1] thread
# cleanup[1] gc
# cleanup[1] select
# cleanup[1] abc
# cleanup[1] _weakrefset
# cleanup[1] gettext
# cleanup[1] sre_constants
# cleanup[1] constants
# cleanup[1] _codecs
# cleanup[1] zope
# cleanup[1] collections
# cleanup[1] _struct
# cleanup[1] _heapq
# cleanup[1] _warnings
# cleanup[1] shlex
# cleanup[1] fcntl
# cleanup[1] zipimport
# cleanup[1] _sysconfigdata
# cleanup[1] optparse
# cleanup[1] struct
# cleanup[1] textwrap
# cleanup[1] _collections
# cleanup[1] strop
# cleanup[1] _functools
# cleanup[1] keyword
# cleanup[1] signal
# cleanup[1] traceback
# cleanup[1] marshal
# cleanup[1] itertools
# cleanup[1] posix
# cleanup[1] exceptions
# cleanup[1] _weakref
# cleanup[1] heapq
# cleanup[1] locale
# cleanup[1] functools
# cleanup[1] encodings
# cleanup[1] operator
# cleanup[1] string
# cleanup[1] encodings.utf_8
# cleanup[1] codecs
# cleanup[1] encodings.aliases
# cleanup[1] re
# cleanup[1] _locale
# cleanup[1] sre_compile
# cleanup[1] _sre
# cleanup[1] sre_parse
# cleanup[2] copy_reg
# cleanup[2] xml.dom
# cleanup[2] xml.dom.NodeFilter
# cleanup[2] xml
# cleanup[2] posixpath
# cleanup[2] errno
# cleanup[2] _abcoll
# cleanup[2] xml.dom.minicompat
# cleanup[2] types
# cleanup[2] genericpath
# cleanup[2] stat
# cleanup[2] warnings
# cleanup[2] UserDict
# cleanup[2] xml.dom.domreg
# cleanup[2] copy
# cleanup[2] os.path
# cleanup[2] xml.dom.minidom
# cleanup[2] weakref
# cleanup[2] linecache
# cleanup[2] time
# cleanup[2] xml.dom.xmlbuilder
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 726 unfreed ints
# cleanup floats
我也尝试过烘焙并得到以下结果:
user@user-PC /home/user-PC/ns-allinone-3.25/bake/bake
$ ./Bake.py build
./Bake.py: line 26: $' \n Bake.py\n\n This is the main Bake file, it stores all the classes related to the\n basic Bake operation. The class Bake is responsible to identify and \n execute the defined options \n': command not found
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
./Bake.py: line 29: try:: command not found
./Bake.py: line 30: from: command not found
./Bake.py: line 31: except: command not found
./Bake.py: line 32: from: command not found
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
./Bake.py: line 39: from: command not found
./Bake.py: line 40: from: command not found
./Bake.py: line 41: from: command not found
./Bake.py: line 42: from: command not found
./Bake.py: line 43: from: command not found
./Bake.py: line 44: from: command not found
./Bake.py: line 45: from: command not found
./Bake.py: line 46: from: command not found
./Bake.py: line 47: from: command not found
./Bake.py: line 48: from: command not found
./Bake.py: line 50: syntax error near unexpected token `('
./Bake.py: line 50: `def signal_handler(signal, frame):'
Here 是 cygcheck -c
输出。
如何成功安装 NS-3?
关注
https://www.nsnam.org/docs/release/3.25/tutorial/singlehtml/index.html#building-ns3
似乎有效。 (第一步编译2357个文件,有点长)
调试您的问题并保存所有日志记录,以便更好地了解缺少的内容:
python -v build.py |& tee build.log
我需要 运行 在我的 windows 7 上安装 NS-3 模拟器,所以我安装了 cygwin 和 devel、python 和 utils 包。我在 运行 ./build.py
命令如下时遇到问题:
Traceback (most recent call last):
File "./build.py", line 10, in <module>
from util import run_command, fatal, CommandError
File "/home/user-PC/ns-allinone-3.25/util.py", line 3, in <module>
import subprocess
File "/usr/lib/python2.7/subprocess.py", line 430, in <module>
import pickle
File "/usr/lib/python2.7/pickle.py", line 1266, in <module>
import binascii as _binascii
ImportError: No such file or directory
请注意,我将目录更改为包含 build.py 文件和 {system root}/cygwin/home/user-PC
目录中 ns-3 其他文件的目录。
在我的 ns-3.25 文件夹中,我有以下文件:
AUTHORS、doc、Makefile、scratch、testpy.supp、VERSION、waf-tools 绑定、示例、README、src、utils、waf、wscript CHANGES.html、LICENSE、RELEASE_NOTES , test.py, utils.py, waf.bat, wutils.py.
虽然在这个版本的 ns-3 的主文件夹中,我有以下包括 ns-3.25 的文件夹:
烘焙,constants.pyc,pybindgen-0.17.0.post49+ng0e4e3bc,util.pyc, build.py、netanim-3.107、自述文件、constants.py、ns-3.25、util.py。
我试过这个命令 python -v build.py |& tee build.log
并得到以下结果:
user@user-PC /home/user-PC/ns-allinone-3.25
$ python -v build.py |& tee build.log
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
import site # precompiled from /usr/lib/python2.7/site.pyc
# /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
import os # precompiled from /usr/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
import posixpath # precompiled from /usr/lib/python2.7/posixpath.pyc
# /usr/lib/python2.7/stat.pyc matches /usr/lib/python2.7/stat.py
import stat # precompiled from /usr/lib/python2.7/stat.pyc
# /usr/lib/python2.7/genericpath.pyc matches /usr/lib/python2.7/genericpath.py
import genericpath # precompiled from /usr/lib/python2.7/genericpath.pyc
# /usr/lib/python2.7/warnings.pyc matches /usr/lib/python2.7/warnings.py
import warnings # precompiled from /usr/lib/python2.7/warnings.pyc
# /usr/lib/python2.7/linecache.pyc matches /usr/lib/python2.7/linecache.py
import linecache # precompiled from /usr/lib/python2.7/linecache.pyc
# /usr/lib/python2.7/types.pyc matches /usr/lib/python2.7/types.py
import types # precompiled from /usr/lib/python2.7/types.pyc
# /usr/lib/python2.7/UserDict.pyc matches /usr/lib/python2.7/UserDict.py
import UserDict # precompiled from /usr/lib/python2.7/UserDict.pyc
# /usr/lib/python2.7/_abcoll.pyc matches /usr/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.7/_abcoll.pyc
# /usr/lib/python2.7/abc.pyc matches /usr/lib/python2.7/abc.py
import abc # precompiled from /usr/lib/python2.7/abc.pyc
# /usr/lib/python2.7/_weakrefset.pyc matches /usr/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/lib/python2.7/copy_reg.pyc matches /usr/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.7/copy_reg.pyc
# /usr/lib/python2.7/traceback.pyc matches /usr/lib/python2.7/traceback.py
import traceback # precompiled from /usr/lib/python2.7/traceback.pyc
# /usr/lib/python2.7/sysconfig.pyc matches /usr/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/lib/python2.7/sysconfig.pyc
# /usr/lib/python2.7/re.pyc matches /usr/lib/python2.7/re.py
import re # precompiled from /usr/lib/python2.7/re.pyc
# /usr/lib/python2.7/sre_compile.pyc matches /usr/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.7/sre_parse.pyc matches /usr/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.7/sre_parse.pyc
# /usr/lib/python2.7/sre_constants.pyc matches /usr/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.7/sre_constants.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_locale.dll", 2);
import _locale # dynamically loaded from /usr/lib/python2.7/lib-dynload/_locale.dll
# /usr/lib/python2.7/_sysconfigdata.pyc matches /usr/lib/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from /usr/lib/python2.7/_sysconfigdata.pyc
# zipimport: found 90 names in /usr/lib/python2.7/site-packages/paramiko-1.16.0-py2.7.egg
# zipimport: found 29 names in /usr/lib/python2.7/site-packages/ecdsa-0.13-py2.7.egg
import encodings # directory /usr/lib/python2.7/encodings
# /usr/lib/python2.7/encodings/__init__.pyc matches /usr/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.7/encodings/__init__.pyc
# /usr/lib/python2.7/codecs.pyc matches /usr/lib/python2.7/codecs.py
import codecs # precompiled from /usr/lib/python2.7/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.7/encodings/aliases.pyc matches /usr/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.7/encodings/aliases.pyc
# /usr/lib/python2.7/encodings/utf_8.pyc matches /usr/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.7/encodings/utf_8.pyc
Python 2.7.10 (default, Jun 1 2015, 18:05:38)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
# /usr/lib/python2.7/__future__.pyc matches /usr/lib/python2.7/__future__.py
import __future__ # precompiled from /usr/lib/python2.7/__future__.pyc
# /usr/lib/python2.7/optparse.pyc matches /usr/lib/python2.7/optparse.py
import optparse # precompiled from /usr/lib/python2.7/optparse.pyc
# /usr/lib/python2.7/textwrap.pyc matches /usr/lib/python2.7/textwrap.py
import textwrap # precompiled from /usr/lib/python2.7/textwrap.pyc
# /usr/lib/python2.7/string.pyc matches /usr/lib/python2.7/string.py
import string # precompiled from /usr/lib/python2.7/string.pyc
dlopen("/usr/lib/python2.7/lib-dynload/strop.dll", 2);
import strop # dynamically loaded from /usr/lib/python2.7/lib-dynload/strop.dll
# /usr/lib/python2.7/gettext.pyc matches /usr/lib/python2.7/gettext.py
import gettext # precompiled from /usr/lib/python2.7/gettext.pyc
# /usr/lib/python2.7/locale.pyc matches /usr/lib/python2.7/locale.py
import locale # precompiled from /usr/lib/python2.7/locale.pyc
dlopen("/usr/lib/python2.7/lib-dynload/operator.dll", 2);
import operator # dynamically loaded from /usr/lib/python2.7/lib-dynload/operator.dll
# /usr/lib/python2.7/functools.pyc matches /usr/lib/python2.7/functools.py
import functools # precompiled from /usr/lib/python2.7/functools.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_functools.dll", 2);
import _functools # dynamically loaded from /usr/lib/python2.7/lib-dynload/_functools.dll
# /usr/lib/python2.7/copy.pyc matches /usr/lib/python2.7/copy.py
import copy # precompiled from /usr/lib/python2.7/copy.pyc
# /usr/lib/python2.7/weakref.pyc matches /usr/lib/python2.7/weakref.py
import weakref # precompiled from /usr/lib/python2.7/weakref.pyc
# /usr/lib/python2.7/struct.pyc matches /usr/lib/python2.7/struct.py
import struct # precompiled from /usr/lib/python2.7/struct.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_struct.dll", 2);
import _struct # dynamically loaded from /usr/lib/python2.7/lib-dynload/_struct.dll
import xml # directory /usr/lib/python2.7/xml
# /usr/lib/python2.7/xml/__init__.pyc matches /usr/lib/python2.7/xml/__init__.py
import xml # precompiled from /usr/lib/python2.7/xml/__init__.pyc
import xml.dom # directory /usr/lib/python2.7/xml/dom
# /usr/lib/python2.7/xml/dom/__init__.pyc matches /usr/lib/python2.7/xml/dom/__init__.py
import xml.dom # precompiled from /usr/lib/python2.7/xml/dom/__init__.pyc
# /usr/lib/python2.7/xml/dom/domreg.pyc matches /usr/lib/python2.7/xml/dom/domreg.py
import xml.dom.domreg # precompiled from /usr/lib/python2.7/xml/dom/domreg.pyc
# /usr/lib/python2.7/xml/dom/minicompat.pyc matches /usr/lib/python2.7/xml/dom/minicompat.py
import xml.dom.minicompat # precompiled from /usr/lib/python2.7/xml/dom/minicompat.pyc
# /usr/lib/python2.7/xml/dom/minidom.pyc matches /usr/lib/python2.7/xml/dom/minidom.py
import xml.dom.minidom # precompiled from /usr/lib/python2.7/xml/dom/minidom.pyc
# /usr/lib/python2.7/xml/dom/xmlbuilder.pyc matches /usr/lib/python2.7/xml/dom/xmlbuilder.py
import xml.dom.xmlbuilder # precompiled from /usr/lib/python2.7/xml/dom/xmlbuilder.pyc
# /usr/lib/python2.7/xml/dom/NodeFilter.pyc matches /usr/lib/python2.7/xml/dom/NodeFilter.py
import xml.dom.NodeFilter # precompiled from /usr/lib/python2.7/xml/dom/NodeFilter.pyc
# /usr/lib/python2.7/shlex.pyc matches /usr/lib/python2.7/shlex.py
import shlex # precompiled from /usr/lib/python2.7/shlex.pyc
# /usr/lib/python2.7/collections.pyc matches /usr/lib/python2.7/collections.py
import collections # precompiled from /usr/lib/python2.7/collections.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_collections.dll", 2);
import _collections # dynamically loaded from /usr/lib/python2.7/lib-dynload/_collections.dll
# /usr/lib/python2.7/keyword.pyc matches /usr/lib/python2.7/keyword.py
import keyword # precompiled from /usr/lib/python2.7/keyword.pyc
# /usr/lib/python2.7/heapq.pyc matches /usr/lib/python2.7/heapq.py
import heapq # precompiled from /usr/lib/python2.7/heapq.pyc
dlopen("/usr/lib/python2.7/lib-dynload/itertools.dll", 2);
import itertools # dynamically loaded from /usr/lib/python2.7/lib-dynload/itertools.dll
dlopen("/usr/lib/python2.7/lib-dynload/_heapq.dll", 2);
import _heapq # dynamically loaded from /usr/lib/python2.7/lib-dynload/_heapq.dll
import thread # builtin
dlopen("/usr/lib/python2.7/lib-dynload/cStringIO.dll", 2);
import cStringIO # dynamically loaded from /usr/lib/python2.7/lib-dynload/cStringIO.dll
# /home/user-PC/ns-allinone-3.25/constants.pyc matches /home/user-PC/ns-allinone-3.25/constants.py
import constants # precompiled from /home/user-PC/ns-allinone-3.25/constants.pyc
# /home/user-PC/ns-allinone-3.25/util.pyc matches /home/user-PC/ns-allinone-3.25/util.py
import util # precompiled from /home/user-PC/ns-allinone-3.25/util.pyc
# /usr/lib/python2.7/subprocess.pyc matches /usr/lib/python2.7/subprocess.py
import subprocess # precompiled from /usr/lib/python2.7/subprocess.pyc
import gc # builtin
dlopen("/usr/lib/python2.7/lib-dynload/time.dll", 2);
import time # dynamically loaded from /usr/lib/python2.7/lib-dynload/time.dll
dlopen("/usr/lib/python2.7/lib-dynload/select.dll", 2);
import select # dynamically loaded from /usr/lib/python2.7/lib-dynload/select.dll
dlopen("/usr/lib/python2.7/lib-dynload/fcntl.dll", 2);
import fcntl # dynamically loaded from /usr/lib/python2.7/lib-dynload/fcntl.dll
# /usr/lib/python2.7/pickle.pyc matches /usr/lib/python2.7/pickle.py
import pickle # precompiled from /usr/lib/python2.7/pickle.pyc
import marshal # builtin
dlopen("/usr/lib/python2.7/lib-dynload/binascii.dll", 2);
Traceback (most recent call last):
File "build.py", line 10, in <module>
from util import run_command, fatal, CommandError
File "/home/user-PC/ns-allinone-3.25/util.py", line 3, in <module>
import subprocess
File "/usr/lib/python2.7/subprocess.py", line 430, in <module>
import pickle
File "/usr/lib/python2.7/pickle.py", line 1266, in <module>
import binascii as _binascii
ImportError: No such file or directory
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] cStringIO
# cleanup[1] __future__
# cleanup[1] site
# cleanup[1] sysconfig
# cleanup[1] thread
# cleanup[1] gc
# cleanup[1] select
# cleanup[1] abc
# cleanup[1] _weakrefset
# cleanup[1] gettext
# cleanup[1] sre_constants
# cleanup[1] constants
# cleanup[1] _codecs
# cleanup[1] zope
# cleanup[1] collections
# cleanup[1] _struct
# cleanup[1] _heapq
# cleanup[1] _warnings
# cleanup[1] shlex
# cleanup[1] fcntl
# cleanup[1] zipimport
# cleanup[1] _sysconfigdata
# cleanup[1] optparse
# cleanup[1] struct
# cleanup[1] textwrap
# cleanup[1] _collections
# cleanup[1] strop
# cleanup[1] _functools
# cleanup[1] keyword
# cleanup[1] signal
# cleanup[1] traceback
# cleanup[1] marshal
# cleanup[1] itertools
# cleanup[1] posix
# cleanup[1] exceptions
# cleanup[1] _weakref
# cleanup[1] heapq
# cleanup[1] locale
# cleanup[1] functools
# cleanup[1] encodings
# cleanup[1] operator
# cleanup[1] string
# cleanup[1] encodings.utf_8
# cleanup[1] codecs
# cleanup[1] encodings.aliases
# cleanup[1] re
# cleanup[1] _locale
# cleanup[1] sre_compile
# cleanup[1] _sre
# cleanup[1] sre_parse
# cleanup[2] copy_reg
# cleanup[2] xml.dom
# cleanup[2] xml.dom.NodeFilter
# cleanup[2] xml
# cleanup[2] posixpath
# cleanup[2] errno
# cleanup[2] _abcoll
# cleanup[2] xml.dom.minicompat
# cleanup[2] types
# cleanup[2] genericpath
# cleanup[2] stat
# cleanup[2] warnings
# cleanup[2] UserDict
# cleanup[2] xml.dom.domreg
# cleanup[2] copy
# cleanup[2] os.path
# cleanup[2] xml.dom.minidom
# cleanup[2] weakref
# cleanup[2] linecache
# cleanup[2] time
# cleanup[2] xml.dom.xmlbuilder
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 726 unfreed ints
# cleanup floats
我也尝试过烘焙并得到以下结果:
user@user-PC /home/user-PC/ns-allinone-3.25/bake/bake
$ ./Bake.py build
./Bake.py: line 26: $' \n Bake.py\n\n This is the main Bake file, it stores all the classes related to the\n basic Bake operation. The class Bake is responsible to identify and \n execute the defined options \n': command not found
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
./Bake.py: line 29: try:: command not found
./Bake.py: line 30: from: command not found
./Bake.py: line 31: except: command not found
./Bake.py: line 32: from: command not found
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
C:/cygwin64/bin/import.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
./Bake.py: line 39: from: command not found
./Bake.py: line 40: from: command not found
./Bake.py: line 41: from: command not found
./Bake.py: line 42: from: command not found
./Bake.py: line 43: from: command not found
./Bake.py: line 44: from: command not found
./Bake.py: line 45: from: command not found
./Bake.py: line 46: from: command not found
./Bake.py: line 47: from: command not found
./Bake.py: line 48: from: command not found
./Bake.py: line 50: syntax error near unexpected token `('
./Bake.py: line 50: `def signal_handler(signal, frame):'
Here 是 cygcheck -c
输出。
如何成功安装 NS-3?
关注 https://www.nsnam.org/docs/release/3.25/tutorial/singlehtml/index.html#building-ns3
似乎有效。 (第一步编译2357个文件,有点长)
调试您的问题并保存所有日志记录,以便更好地了解缺少的内容:
python -v build.py |& tee build.log