由於angr的某些庫需要python版本>=3.6,索性升級到了python3.7
升級python到3.7
sudo add-apt-repository ppa:deadsnakes/ppa
# 添加自定義源
sudo apt-get update
# 更新軟件包
sudo apt-get install python3.7
# 安裝python3.7
sudo apt-get -y install python3.7 python3.7-dev python3-pip
# 安裝python3.7-dev啥玩意和pip
python3.7 -m pip install pip --upgrade
pip install --upgrade pip
# 升級pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
# 設置python的時候出來python3.7
# 設置python3時候出來python3.7
1. 打開.bashrc
vim ~/.bashrc
2. 在.bashrc中添加
alias python3=python3.7
or
alias python3='/usr/bin/python3.7'
3. 保存並退出文件編輯,使配置生效
source ~/.bashrc
# 更改軟鏈接,設置默認喚起python3版本
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
安裝angr
-
安裝依賴
sudo apt-get install python-dev libffi-dev build-essential virtualenvwrapper export WORKON_HOME=$HOME/Python-workhome source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
-
安裝angr
mkvirtualenv angr && pip install angr
(或)
mkvirtualenv --python=$(which python3) angr && pip install angr
-
若報錯:“未找到命令”
進行virtualenvwrapper初始化
輸入
export WORKON_HOME=$HOME/Python-workhome
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
-
若報錯:ERROR: pyvex 7.8.9.26 has requi rement future=-0.16.0, but you’ll have future 0.18.2 which is incompatible.
將python2和python3的future均改爲0.16.0版本
命令:sudo pip uninstall future sudo pip install future==0.16.0 sudo pip3 uninstall future sudo pip3 install future==0.16.0
# 報錯
OSError: Command /home/ palmer/.virtualenvs/angr/bin/ python3
SetuptooLs pkg_resources pip wheel failed with error code 2
# 解決
sudo pip install setuptools
sudo pip install --upgrade setuptools
sudo pip install virtualenv
sudo pip install --upgrade virtualenv
# 報錯
share/virtuaLenvwrapper/virtualenvwrapper.sh
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_Loader' (ImportError: No module named 'virtuaLenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
# 解決
sudo apt-get install python3-pip
sudo pip3 install virtualenv virtualenvwrapper
source .bashrc
mkvirtualenv --python=$(which python3) angr
# 離線安裝pip包cle-8.20.1.7
# (如果install angr可以安裝,則無需手動安裝)
pip install angr