Introduction to the environment
OS: CentOS7.9.2009
Mem: 12G
CPU: 4C
Disk: 80G
Network: Bridge
IP: 192.168.1.120/24
install python
yum -y install wget zlib zlib-devel bzip2-devel openssl-devel \
ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel \
db4-devel libpcap-devel xz-devel libffi-devel gcc gcc-c++ \
vim mesa-libGL.x86_64 git
mkdir /software /usr/local/python3 && cd /software
wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz
tar xf Python-3.11.1.tgz
cd Python-3.11.1
./configure prefix=/usr/local/python3 --with-ensurepip=install
make -j4 && make install
vim /etc/profile
export PYTHON_HOME=/usr/local/python3
export PATH=$PYTHON_HOME/bin:$PATH
source /etc/profile
python3 --version
install conda
wget https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2022.10-Linux-x86_64.sh --no-check-certificate
bash Anaconda3-2022.10-Linux-x86_64.sh
接下来会出现一堆的License许可声明,注:按空格键来一页一页的翻
出现如下文字,输入yes
Do you accept the license terms? [yes|no]
[no] >>> yes
接下来要选择安装目录,如果无需更改直接回车即可,如需更改要输入绝对路径:
注:可以先查看下硬盘的挂载情况再自行选择安装目录 (df -Th)
Anaconda3 will now be installed into this location:
/root/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/anaconda3] >>> /anaconda3 # 不需要提前创建/anaconda3目录,如无则会新创建
等一会儿后会问是否需要进行conda的初始化,建议输入no。
若选择yes会在/root/.bashrc目录中自动添加环境变量,会使得开机自动启动base环境。
(这里应该是新版安装包的改动之处,老版本的安装包都是问是否需要添加conda至环境变量,
且默认直接回车Enter是不添加,若未添加后续需要手动添加)
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> no
看到如下提示则安装成功:
Thank you for installing Anaconda3!
==================================================================
Working with Python and Jupyter is a breeze in DataSpell. It is an IDE
designed for exploratory data analysis and ML. Get better data insights
with DataSpell.
DataSpell for Anaconda is available at: https://www.anaconda.com/dataspell