Windows安装Python3
下载安装包:
Win10及以上下载python3.13.7
Win7下载python3.8.10
双击刚刚下载的exe文件,在安装界面,不要勾选Install launcher for all uers,一定要勾选Add Python 3.x to PATH,然后点Install Now
检查:安装完成后,在系统环境变量PATH中应有如下条目
%LOCALAPPDATA%\Programs\Python\Python3x\
%LOCALAPPDATA%\Programs\Python\Python3x\Scripts\
%LOCALAPPDATA%\Programs\Python\Launcher\
Linux安装Python3.11
linux建议直接使用包管理器安装。如果一定要直接安装的话,无脑执行以下代码
yum -y install gcc zlib zlib-devel libffi libffi-devel readline-devel openssl-devel openssl11 openssl11-devel
export CFLAGS=$(pkg-config --cflags openssl11)
export LDFLAGS=$(pkg-config --libs openssl11)
cd ~
wget https://registry.npmmirror.com/-/binary/python/3.11.8/Python-3.11.8.tgz
tar -xzf Python-3.11.8.tgz
cd Python-3.11.8
./configure --with-ssl
make
make install
第三方库镜像源配置
执行以下代码:
pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple