Anaconda安装fpylll库教程
Anaconda(Ubuntu20.04上)安装fpylll库教程写在最前面:本来是想直接在Windows上安装fpylll库和sage库的,后来发现fpylll库的依赖库fplll和sage库在windows版的Anaconda上都无法安装,所以我只能退而将其安装在linux内核上了,结果linux内核要安装图形化界面非常麻烦,我只能选择在虚拟机上操作。一开始用的Win10自带的hyper-V,
Anaconda(Ubuntu20.04上)安装fpylll库教程
写在最前面:本来是想直接在Windows上安装fpylll库和sage库的,后来发现fpylll库的依赖库fplll和sage库在windows版的Anaconda上都无法安装,所以我只能退而将其安装在linux内核上了,结果linux内核要安装图形化界面非常麻烦,我只能选择在虚拟机上操作。一开始用的Win10自带的hyper-V,但hyper-V的vm tool不支持Ubuntu20.04,最后博主只能选择在vmware上跑ubuntu来安装fpylll库。
本教程所用的Linux:Ubuntu20.04;本教程所用虚拟机平台:VMware Workstation Pro
1. 使用vmware安装Ubuntu虚拟机
2. 更新Ubuntu
打开Ubuntu,输入命令:
sudo apt-get update
sudo apt-get upgrade
2. 在Ubuntu上安装Anaconda
下载链接:https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
下载后,在其所在文件夹执行命令,记得设置安装的目录,添加路径(按自己的anaconda安装文件夹设置路径,否则会无法使用conda):
bash Anaconda3-2020.11-Linux-x86_64.sh
vim /etc/profile
export PATH="/home/user/anaconda/bin:$PATH" #在文件最后一行输入anconda的bin文件夹目录
source /etc/profile
3. 安装fpylll依赖库
(1)安装gmp库
sudo apt-get install m4
sudo apt install libgmp-dev
参考博客:https://blog.csdn.net/just_h/article/details/82667787
(2)安装mpir库
sudo apt-get install libtool #依赖包
sudo apt-get install yasm #依赖包
sudo apt-get install texinfo #依赖包
libtoolize --automake --copy --debug --force
git clone git://github.com/wbhart/mpir.git mpir #下载安装包
cd mpir #进入mpir目录
aclocal
autoconf
automake --add-missing
./configure
make
make check
sudo make install
参考博客:[1] https://blog.csdn.net/caorui_nk/article/details/84779109
[2] https://blog.csdn.net/caizi001/article/details/38871141
[3] https://trac.macports.org/ticket/57244
[4] https://blog.csdn.net/xuezhimeng2010/article/details/49070169
(3)安装mpfr库
sudo apt install libmpfr-dev
(2)安装QD包
sudo apt install libqd-dev
或者直接下载安装包安装:
QD包下载链接:https://www.davidhbailey.com/dhbsoftware/qd-2.3.22.tar.gz
#先解压缩,进入目录
sudo apt install gcc #需要先安装gcc库和g++库
sudo apt install g++
sudo pip install numpy #依赖库
./configure --enable-shared=yes
make
make check
sudo make install
(3)安装fplll库
git clone https://github.com/fplll/fplll.git
cd fplll
./autogen.sh
./configure
make && make check && sudo make install
(4)安装Cython库
pip install Cython
(5)安装cysignals库
#python3
sudo pip3 install setuptools #安装依赖包
sudo pip3 install cython #安装依赖包
sudo pip3 install sphinx #安装依赖包
pip3 install cysignals
#python2 可能出现无法直接pip安装的问题,提供以下安装方式
#参考:https://github.com/fplll/fpylll/issues/96
git clone https://github.com/sagemath/cysignals.git cysignals
cd cysignals
pip install -r requirements.txt #站桩requirements.txt中给的依赖
sudo apt-get install python-dev #python依赖
sudo python setup.py install --old-and-unmanageable
(6)安装py.test库
pip install pytest
(7)安装flake8库
pip install flake8
(8)安装virtualenv库
pip install virtualenv
pip install virtualenvwrapper
2. 安装fpylll库
sudo apt install autotools-dev #依赖包
git clone https://github.com/fplll/fpylll.git
#进入fplll文件夹
./bootstrap.sh
source ./activate
更多推荐



所有评论(0)