Ubuntu下Androguard的環境搭建
一、安裝python(這裏以Python 2.7.3 爲例)
編譯前在/usr/local新建一個文件夾,作爲python安裝路徑,以免覆蓋老的版本
sudo mkdir /usr/local/python2.7.3
下載Python的鏡像包
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
解壓:
tar -zxvf Python-2.7.3.tgz
cd Python-2.7.3
在解壓後的目錄下編譯安裝:
./configure --prefix=/usr/local/python2.7.3
make
sudo make install
(這裏可能報錯,可能是因爲沒有安裝gcc-c++,sudo yum -y install gcc-c++)
將原來/usr/bin/python的鏈接改爲別的名字:
sudo mv /usr/bin/python /usr/bin/python_old
建立新版本python的鏈接:
sudo ln -s /usr/local/python2.7.3/bin/python2.7 /usr/bin/python
測試安裝成功
二、安裝相關模塊
2.1 安裝pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo ln -sf /usr/local/python2.7.3/bin/pip /usr/bin/pip
sudo ln -sf /usr/local/python2.7.3/bin/easy_install /usr/bin/easy_install
2.2 安裝IPython
sudo pip install ipython
sudo ln -s /usr/local/python2.7.3/bin/ipython /usr/bin/ipython
2.3 安裝擴展模塊
apt-get install python2.7-dev python-bzutils libbz2-dev libmuparser-dev libsparsehash-dev
apt-get install python-ptrace python-pygments graphviz liblzma-dev libsnappy-dev
apt-get install python python-pyqt5 python-pyperclip python-networkx ipython python-future python-pyasn1
apt-get install python-cryptography python-magic python-pydot
Windows下Androguard的環境搭建
1. Windows 下安裝 setuptools 步驟
步驟1:打開網頁鏈接 https://pypi.python.org/pypi/setuptools/0.9.8#windows
步驟2:下載ez_setup.py,然後在cmd命令行中,運行:
python ez_setup.py
步驟3: 安裝完成後,找到安裝目錄,我的在Python2.7的安裝目錄下,即C:\Python27\Scripts,添加到Path環境變量。在cmd下運行easy_install –help 出現幫助信息則安裝成功
步驟4:接下來你就可以採用easy_install安裝自己想要的工具包了,比如在cmd窗口執行easy_install pyparsing
2. 安裝依賴庫
2.1 安裝ipython
easy_install ipython
報錯信息:
error: Setup script exited with error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27
解決辦法:安裝 Microsoft Visual C++ Compiler for Python 2.7
下載地址:
https://www.microsoft.com/en-us/download/details.aspx?id=44266
安裝成功顯示:
D:\Python27\Scripts>ipython -V
5.3.0
2.2 安裝pygments,pydot, python-ptrace, chilkat, python-magic, pyfuzzy, mercury,pyperclip,sphinxcontrib-programoutput,future,pydot
問題一:
安裝chilkat的時候報錯
D:\Python27\Scripts>easy_install chilkat
Searching for chilkat
Reading https://pypi.python.org/simple/chilkat/
Couldn't find index page for 'chilkat' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for chilkat
error: Could not find suitable distribution for Requirement.parse('chilkat')
解決辦法:手動下載chilkat
下載網址:https://www.chilkatsoft.com/python.asp
安裝:
python installChilkat.py
問題二:
D:\Python27\Scripts>easy_install pyfuzzy
Searching for pyfuzzy
Reading https://pypi.python.org/simple/pyfuzzy/
No local packages or download links found for pyfuzzy
error: Could not find suitable distribution for Requirement.parse('pyfuzzy')
解決辦法:手動下載pyfuzzy
下載網址:http://pyfuzzy.sourceforge.net/
安裝:
python setup.py install
問題三:
D:\Python27\Scripts>easy_install mercury
Searching for mercury
Reading https://pypi.python.org/simple/mercury/
No local packages or download links found for mercury
error: Could not find suitable distribution for Requirement.parse('mercury')
解決辦法:手動下載mercury,先安裝openssl.exe
openssl下載網址:https://pypi.python.org/pypi/pyOpenSSL/0.13
mercury下載網址:http://download.csdn.net/detail/oatnehc/5481921
安裝:
python setup.py install
2. 安裝Androguard
下載源碼:https://github.com/androguard/androguard
安裝:
python setup.py install