1、conda环境
使用魔戒.net 搭建梯子,用Mihomo party作为 可视化工具
直接在google上下载 miniconda,安装即可,安装完毕后。
1.1 给conda 配置 换源地址:
conda --version 看版本
conda config --show channels 看源渠道
执行下面的,增加换源渠道
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls
需要工conda创建一个虚拟环境:
conda create -n lcyPyPro python==3.9
2、pytorch环境
2.1 配置pip的换源地址
新建一个这个文件 ~/.pip/pip.conf
里面写入下面的,然后保存:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
2.2 用conda 切换到自己的虚拟环境里面
conda env list 列出自己新建的虚拟环境
conda activate 已经新建的虚拟环境名字
此时命令行前面没有了(base)
2.3 写好requirments.txt
absl-py==2.1.0
astunparse==1.6.3
certifi==2024.12.14
charset-normalizer==3.4.1
et_xmlfile==2.0.0
filelock==3.16.1
flatbuffers==24.12.23
fuxictr==2.3.7
gast==0.6.0
google-pasta==0.2.0
grpcio==1.69.0
h2o==3.46.0.6
h5py==3.12.1
idna==3.10
imbalanced-learn==0.12.4
imblearn==0.0
importlib_metadata==8.5.0
Jinja2==3.1.5
joblib==1.4.2
keras==3.8.0
Keras-Preprocessing==1.1.2
libclang==18.1.1
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
ml-dtypes==0.3.2
mpmath==1.3.0
namex==0.0.8
networkx==3.2.1
numpy==1.26.4
openpyxl==3.1.5
opt_einsum==3.4.0
optree==0.13.1
packaging==24.2
pandas==2.2.3
pillow==11.1.0
polars==1.22.0
protobuf==4.25.5
py4j==0.10.9.7
pyarrow==19.0.1
Pygments==2.19.1
pyspark==3.5.4
python-dateutil==2.9.0.post0
pytz==2024.2
PyYAML==6.0.2
requests==2.32.3
rich==13.9.4
scikit-learn==1.6.0
scipy==1.13.1
six==1.17.0
sympy==1.13.3
tabulate==0.9.0
tensorboard==2.16.2
tensorboard-data-server==0.7.2
tensorflow==2.16.2
tensorflow-io-gcs-filesystem==0.37.1
termcolor==2.5.0
threadpoolctl==3.5.0
torch==2.2.2
torchaudio==2.2.2
torchvision==0.17.2
tqdm==4.67.1
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.3.0
Werkzeug==3.1.3
wrapt==1.17.0
xgboost==2.1.3
zipp==3.21.0
然后 执行 pip install -r requirments.txt