【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
相关推荐
Julyyyyyyyyyyy1 小时前
【软件测试】web自动化:Pycharm+Selenium+Firefox(一)
python·selenium·pycharm·自动化
Fanxt_Ja2 小时前
【JVM】三色标记法原理
java·开发语言·jvm·算法
蓝婷儿2 小时前
6个月Python学习计划 Day 15 - 函数式编程、高阶函数、生成器/迭代器
开发语言·python·学习
love530love2 小时前
【笔记】在 MSYS2(MINGW64)中正确安装 Rust
运维·开发语言·人工智能·windows·笔记·python·rust
水银嘻嘻2 小时前
05 APP 自动化- Appium 单点触控& 多点触控
python·appium·自动化
slandarer2 小时前
MATLAB | 绘图复刻(十九)| 轻松拿捏 Nature Communications 绘图
开发语言·matlab
狐凄2 小时前
Python实例题:Python计算二元二次方程组
开发语言·python
roman_日积跬步-终至千里3 小时前
【Go语言基础【3】】变量、常量、值类型与引用类型
开发语言·算法·golang
roman_日积跬步-终至千里3 小时前
【Go语言基础】基本语法
开发语言·golang·xcode
Felven3 小时前
C. Basketball Exercise
c语言·开发语言