由于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