【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
相关推荐
我爱写代码i5 小时前
BeLink - 支持生成多种URL 缩短网址PHP源码
开发语言·php·短网址php源码
Java后端的Ai之路6 小时前
20、Python - 备忘录模式
开发语言·人工智能·python·外观模式·备忘录模式
2601_962077716 小时前
基于Python与NLP的新闻事件信息抽取实战:从NER到时空标准化
python·nlp·transformers·spacy·新闻事件抽取
JavaPub-rodert6 小时前
LangChain 从入门到 Agent 实战:用 Python 搭建一个真正能调用工具和知识库的 AI 助手
人工智能·python·langchain
统计学小王子7 小时前
数学建模国赛倒计时4天——《统计模型精讲(混合效应模型R语言实现)》
开发语言·数学建模·r语言
知无不研7 小时前
c语言中循环的介绍与简单应用
c语言·开发语言·算法·循环·for·while
郝学胜-神的一滴7 小时前
Qt 高级编程 045:坐标体系深度实战
开发语言·c++·windows·python·qt·程序人生
dsyyyyy11017 小时前
JS复习,难点,易错点总结
开发语言·javascript·ecmascript
m0_380743878 小时前
给 OpenAI API 调用加上模型切换:GPT-5.1 和 Codex 的配置实践
人工智能·python·gpt
2601_962297488 小时前
在python3中、下列输出变量a的正确写法是_2020超星大数据Python免费答案
数据结构·python·算法·编程·字符串操作