【Django】anaconda环境变量配置及配置python虚拟环境

文章目录

配置环境变量

cmd 复制代码
control sysdm.cpl,,3
  • 笔者anaconda安装目录为C:\ProgramData\anaconda3
    那么需要加入path中的有如下三个
    C:\ProgramData\anaconda3
    C:\ProgramData\anaconda3\Scripts
    C:\ProgramData\anaconda3\Library\bin

配置python虚拟环境

首先进入base环境

cmd 复制代码
conda create -n mydjango python

查看列表

cmd 复制代码
conda env list

激活

cmd 复制代码
conda activate mydjango

如果不小心弄错了,删除方法如下:

conda 复制代码
conda remove --name mydjango --all

查看conda源并配置国内源

  1. 查看已经存在的镜像源
bash 复制代码
conda config --show channels
  1. 添加清华大学镜像源
cmd 复制代码
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch

https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

cmd 复制代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

在虚拟环境中安装django

python 复制代码
pip install django
相关推荐
景天科技苑4 分钟前
【Rust结构体】Rust结构体详解:从基础到高级应用
开发语言·后端·rust·结构体·关联函数·rust结构体·结构体方法
倔强的石头10639 分钟前
【C++指南】位运算知识详解
java·开发语言·c++
攻城狮7号42 分钟前
Python爬虫第19节-动态渲染页面抓取之Splash使用下篇
开发语言·爬虫·python·python爬虫
天天进步20151 小时前
Python项目--基于计算机视觉的手势识别控制系统
开发语言·python·计算机视觉
mozun20201 小时前
QT:Qt5 串口模块 (QSerialPort) 在 VS2015 中正确关闭串口避免被占用
开发语言·c++·qt·串口·串口调试·上位机软件
小刘同学++1 小时前
Qt 中线程使用
开发语言·qt
徐寿春1 小时前
规则引擎 - Easy Rules
java·开发语言
byte轻骑兵1 小时前
【C++ 类和数据抽象】static 类成员
开发语言·c++
MarsBighead1 小时前
Pgvector+R2R搭建RAG知识库
python·ai·postgresql·rag·pgvector
努力学习的小廉1 小时前
【C++】 —— 笔试刷题day_24
开发语言·c++