pip/conda导出 requirements.txt 注意事项

December 17, 2023
测试
测试
测试
测试
15 分钟阅读

pip

使用 pip freeze > ./requirements.txt 导出 requirements.txt 发现很多包没有版本号,而是 @ file:///

在这里插入图片描述
在这里插入图片描述

使用pip list --format=freeze > ./requirements.txt 导入安装 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

conda

导出 conda list -e > requirements.txt 导入安装 conda install --yes --file requirements.txt

导出 yml 文件方式 conda env export > freeze.yml 安装 conda env create -f freeze.yml

  • pytorch1.10.1+paddlepaddle-gpu2.2.1+cuda10.2+cudnn7.6.5 conda 环境freeze.yml 文件内容
name: torch_paddle
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/peterjc123/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=4.5=1_gnu
  - astor=0.8.1=py38h06a4308_0
  - blas=1.0=mkl
  - brotlipy=0.7.0=py38h27cfd23_1003
  - bzip2=1.0.8=h7b6447c_0
  - ca-certificates=2021.10.26=h06a4308_2
  - certifi=2021.10.8=py38h06a4308_2
  - cffi=1.14.6=py38h400218f_0
  - charset-normalizer=2.0.4=pyhd3eb1b0_0
  - cryptography=36.0.0=py38h9ce1e76_0
  - cudatoolkit=10.2.89=hfd86e86_1
  - cudnn=7.6.5=cuda10.2_0
  - decorator=5.1.0=pyhd3eb1b0_0
  - ffmpeg=4.3=hf484d3e_0
  - freetype=2.11.0=h70c0345_0
  - gast=0.3.3=py_0
  - giflib=5.2.1=h7b6447c_0
  - gmp=6.2.1=h2531618_2
  - gnutls=3.6.15=he1e5248_0
  - idna=3.3=pyhd3eb1b0_0
  - intel-openmp=2021.4.0=h06a4308_3561
  - jpeg=9d=h7f8727e_0
  - lame=3.100=h7b6447c_0
  - lcms2=2.12=h3be6417_0
  - ld_impl_linux-64=2.35.1=h7274673_9
  - libffi=3.3=he6710b0_2
  - libgcc-ng=9.3.0=h5101ec6_17
  - libgomp=9.3.0=h5101ec6_17
  - libiconv=1.15=h63c8f33_5
  - libidn2=2.3.2=h7f8727e_0
  - libpng=1.6.37=hbc83047_0
  - libprotobuf=3.19.1=h4ff587b_0
  - libstdcxx-ng=9.3.0=hd4cf53a_17
  - libtasn1=4.16.0=h27cfd23_0
  - libtiff=4.2.0=h85742a9_0
  - libunistring=0.9.10=h27cfd23_0
  - libuv=1.40.0=h7b6447c_0
  - libwebp=1.2.0=h89dd481_0
  - libwebp-base=1.2.0=h27cfd23_0
  - lz4-c=1.9.3=h295c915_1
  - mkl=2021.4.0=h06a4308_640
  - mkl-service=2.4.0=py38h7f8727e_0
  - mkl_fft=1.3.1=py38hd3c417c_0
  - mkl_random=1.2.2=py38h51133e4_0
  - ncurses=6.3=h7f8727e_2
  - nettle=3.7.3=hbbd107a_1
  - numpy=1.21.2=py38h20f2e39_0
  - numpy-base=1.21.2=py38h79a1101_0
  - olefile=0.46=pyhd3eb1b0_0
  - openh264=2.1.1=h4ff587b_0
  - openssl=1.1.1m=h7f8727e_0
  - paddlepaddle-gpu=2.2.1=py38_gpu_cuda10.2_many_linux
  - pillow=8.4.0=py38h5aabda8_0
  - pip=21.2.4=py38h06a4308_0
  - protobuf=3.19.1=py38h295c915_0
  - pycparser=2.21=pyhd3eb1b0_0
  - pyopenssl=21.0.0=pyhd3eb1b0_1
  - pysocks=1.7.1=py38h06a4308_0
  - python=3.8.12=h12debd9_0
  - pytorch=1.10.1=py3.8_cuda10.2_cudnn7.6.5_0
  - pytorch-mutex=1.0=cuda
  - readline=8.1.2=h7f8727e_1
  - requests=2.27.1=pyhd3eb1b0_0
  - setuptools=58.0.4=py38h06a4308_0
  - six=1.16.0=pyhd3eb1b0_0
  - sqlite=3.37.0=hc218d9a_0
  - tk=8.6.11=h1ccaba5_0
  - torchaudio=0.10.1=py38_cu102
  - torchvision=0.11.2=py38_cu102
  - typing_extensions=3.10.0.2=pyh06a4308_0
  - urllib3=1.26.7=pyhd3eb1b0_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.2.5=h7b6447c_0
  - zlib=1.2.11=h7f8727e_4
  - zstd=1.4.9=haebb681_0
  - pip:
    - ahocorasick-rs==0.12.0
    - asgiref==3.4.1
    - attrs==21.4.0
    - click==8.0.3
    - colorama==0.4.4
    - colorlog==6.6.0
    - dill==0.3.4
    - fastapi==0.68.1
    - filelock==3.4.2
    - h11==0.12.0
    - h5py==3.6.0
    - huggingface-hub==0.4.0
    - importlib-resources==5.4.0
    - jieba==0.42.1
    - joblib==1.1.0
    - jsonschema==4.4.0
    - kafka-python==2.0.2
    - loguru==0.5.3
    - multiprocess==0.70.12.2
    - packaging==21.3
    - paddlenlp==2.2.3
    - psutil==5.9.0
    - pydantic==1.8.2
    - pyparsing==3.0.6
    - pypinyin==0.44.0
    - pyrsistent==0.18.1
    - python-dotenv==0.19.0
    - pyyaml==6.0
    - regex==2022.1.18
    - sacremoses==0.0.47
    - scikit-learn==1.0.2
    - scipy==1.7.3
    - seqeval==1.2.2
    - starlette==0.14.2
    - threadpoolctl==3.0.0
    - tokenizers==0.10.3
    - tqdm==4.62.3
    - transformers==4.15.0
    - uvicorn==0.17.0
    - zipp==3.7.0
prefix: /anaconda3/envs/tp

继续阅读

更多来自我们博客的帖子

如何安装 BuddyPress
由 测试 December 17, 2023
经过差不多一年的开发,BuddyPress 这个基于 WordPress Mu 的 SNS 插件正式版终于发布了。BuddyPress...
阅读更多
Filter如何工作
由 测试 December 17, 2023
在 web.xml...
阅读更多
如何理解CGAffineTransform
由 测试 December 17, 2023
CGAffineTransform A structure for holding an affine transformation matrix. ...
阅读更多