Nenhuma descrição

marion 19f149fb15 init 3 anos atrás
keygen 688221f336 init 4 anos atrás
pyTorch 688221f336 init 4 anos atrás
spider 688221f336 init 4 anos atrás
tensorflow 688221f336 init 4 anos atrás
.gitignore fa4b0f20af init 4 anos atrás
README.md 19f149fb15 init 3 anos atrás
json_test.py 688221f336 init 4 anos atrás
jwt_test.py 688221f336 init 4 anos atrás
md5_test.py 688221f336 init 4 anos atrás
random_test.py 688221f336 init 4 anos atrás

README.md

Python开发环境准备

安装Miniconda或Anaconda,然后通过conda添加需要的python版本的虚拟环境,便于python版本和包管理

Conda 常用命令

下载地址

虚拟环境

列举

当前环境前面有*号

conda env list

创建

conda create -n py39 python=3.9

删除

conda remove -n py39 --all

激活

conda activate py39

或使用别名

condain py39

退出

conda deactivate py39

或使用别名

condaout py39

配置管理

查看配置

conda config --show

查看channels

conda config --get channels

添加channels

添加国内镜像地址方式即如下

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/bioconda

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

如果获取包出现无法访问win-64或osx-64的current_repodata.json的错误,可以尝试添加带环境的channels地址,例如 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64

默认的 default 不建议删除,实在不能获取包时,开爬墙工具重试

重置channels源为默认,使用

conda config --remove-key channels

删除channels

conda config --remove channels https://------------------------

包管理

查找package信息

conda search XXXX

列举包

包管理命令都可以指定虚拟环境,未指定则对当前虚拟环境操作

conda list -n py39

安装包

conda install -n py39 XXXX==版本号

conda install --yes --file requirements.txt

更新包

包括更新conda本身,如下

conda update -n py39 conda

删除包

conda remove -n py39 XXXX