Test requirements need to use the Scapy library, so in the native configuration scapy environment, but finally prompted the permission problem, may be related to sip.
Finally, the use of virtual environment (VIRTUALENV) is done under the colleague's introduction.
Virtualenv:
Virtualenv is used to create multiple standalone Python runtimes on a single machine, similar to a sandbox environment.
role: Isolate third-party library dependencies between projects, such as a project-dependent xxx1. The 1,b project relies on xxx1.2. To facilitate the deployment of applications, the development environment of the virtual environment packaged into a production environment, do not need to be on the server to toss another turn. Try a new third-party library without worrying about polluting the system environment. Install new components without permission.
1, Configuration Virtualenv
Pip install virtualenv #安装 #virtualenv-h #查看帮助cd document/temp/#在该目录下创建目录virtualenv venv #创建虚拟环境的目录, named Venv, It contains Python executables and copies of the PIP library (can install the required packages to the virtual environment) # virtualenv-p/usr/bin/python2.7 venv#-P option to choose which version of the Python interpreter to use Since this machine has only 2.7 environments, you do not need to configure this step #--no-site-packages option virtualenv will not include packages installed by the physical machine Python environment (this is the default after Virtualenv 1.7 and later)source venv/ Bin/activate #激活刚才创建的虚拟环境 # Deactivate #有必要时可关闭虚拟环境
2, Installation scapy environment
Scapy relies on the library installation will continue to prompt
1. PyX : 2. pcapy3.gnuplot-py
Dnet need to use lib1.12
Dependent libraries: https://github.com/todototry/scapyInstallDependents
Download the dependent libraries above in the Venv directory.
Install individually:
It is important to note that dnet:
CD libdnet-1.12/. /configure & makemake installcd python python setup.py install
Finally confirm whether there are dnet-1.12-py2.7.egg-info dnet.so two files under lib/python2.7/site-packages/
Other libraries can be installed directly in Python setup.py install.
from Import * #测试是否正常
Reference Links:
http://blog.csdn.net/alexzhang67/article/details/52084874
Http://www.cnblogs.com/ToDoToTry/p/5323118.html
Configuring the Scapy environment under MacOS