您的位置:首页 > 健康 > 养生 > 笔记:如何在pycharm中使用anaconda的虚拟环境,新建工程和更改现有工程的虚拟环境。

笔记:如何在pycharm中使用anaconda的虚拟环境,新建工程和更改现有工程的虚拟环境。

2024/10/6 14:35:48 来源:https://blog.csdn.net/weixin_42771529/article/details/139448503  浏览:    关键词:笔记:如何在pycharm中使用anaconda的虚拟环境,新建工程和更改现有工程的虚拟环境。

 1.用anaconda创建虚拟环境


(base) C:\Users\Administrator>conda -V
conda 24.5.0(base) C:\Users\Administrator>conda create -n appenv python
Channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done## Package Plan ##environment location: d:\anaconda3\envs\appenvadded / updated specs:- pythonThe following NEW packages will be INSTALLED:bzip2              anaconda/pkgs/main/win-64::bzip2-1.0.8-h2bbff1b_6ca-certificates    anaconda/pkgs/main/win-64::ca-certificates-2024.3.11-haa95532_0expat              anaconda/pkgs/main/win-64::expat-2.6.2-hd77b12b_0libffi             anaconda/pkgs/main/win-64::libffi-3.4.4-hd77b12b_1openssl            anaconda/pkgs/main/win-64::openssl-3.0.13-h2bbff1b_2pip                anaconda/pkgs/main/win-64::pip-24.0-py312haa95532_0python             anaconda/pkgs/main/win-64::python-3.12.3-h1d929f7_1setuptools         anaconda/pkgs/main/win-64::setuptools-69.5.1-py312haa95532_0sqlite             anaconda/pkgs/main/win-64::sqlite-3.45.3-h2bbff1b_0tk                 anaconda/pkgs/main/win-64::tk-8.6.14-h0416ee5_0tzdata             anaconda/pkgs/main/noarch::tzdata-2024a-h04d1e81_0vc                 anaconda/pkgs/main/win-64::vc-14.2-h2eaa2aa_1vs2015_runtime     anaconda/pkgs/main/win-64::vs2015_runtime-14.29.30133-h43f2093_3wheel              anaconda/pkgs/main/win-64::wheel-0.43.0-py312haa95532_0xz                 anaconda/pkgs/main/win-64::xz-5.4.6-h8cc25b3_1zlib               anaconda/pkgs/main/win-64::zlib-1.2.13-h8cc25b3_1Proceed ([y]/n)? yDownloading and Extracting Packages:Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate appenv
#
# To deactivate an active environment, use
#
#     $ conda deactivate(base) C:\Users\Administrator>

2.真实位置如下:

D:\anaconda3\envs\appenv
 

 3.打开pycharm

4.新建工程,注意第五步最为重要。第六步选择实际想用的环境。

 

 

 

 

 

 进入系统可见成功。以上是新建工程时的方法。

下面演示如何在已有工程中修改这个环境

 

 

点小三角号: 

 

 注意三是点小三角号

 

比如我使用的是最后一个。

等待更新:早知不选最后一个,太太大了。只是演示而已。

 

 重启pytharm ,正常。

cs上大多是修改已有工程的,并且都说得不明白,我个人觉得。所以我的这个应该是最好的。欢迎点赞,让更多人看到。 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com