简体   繁体   English

在 Windows 中创建虚拟环境

[英]Creating Virtual Environment in Windows

I created a virtual environment using conda create -n venv inside the project folder and activated the venv environment.我在项目文件夹中使用conda create -n venv创建了一个虚拟环境并激活了venv环境。 However, I face the following issues:但是,我面临以下问题:

  1. The venv environment is getting created under C:\\Users\\Rajesh\\anaconda3\\envs folder. venv环境正在C:\\Users\\Rajesh\\anaconda3\\envs文件夹下创建。
  2. When I install packages while in the venv environment, the packages not getting installed in venv folder.当我在venv环境中安装软件包时,这些软件包没有安装在venv文件夹中。 Please advise what is going wrong here请告知这里出了什么问题
  1. The default path of virtual env is located $USER/anaconda3/env , no matter where you execute the create command, the env created will be put in this path. virtual env 的默认路径是$USER/anaconda3/env ,无论你在哪里执行 create 命令,创建的 env 都会放在这个路径下。 You could change this default path by editing $HOME/.condarc :您可以通过编辑$HOME/.condarc来更改此默认路径:
envs_dirs:
  - some path you like
pkgs_dirs:
  - some path you like
  1. Are you sure you have executed conda activate venv before installing packages?您确定在安装软件包之前执行了conda activate venv吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM