Conda 常用命令 - PyCharm 和 Conda 虚拟环境连接
Conda 常用命令 - PyCharm 和 Conda 虚拟环境连接1. Creating an environment with commands2. Conda vs. pip vs. virtualenv commands3. PyCharm 和 conda 虚拟环境连接ReferencesCondahttps://conda.io/projects/conda/en/latest/index.htmlCondahttps://conda.io/en/latest/index.htmlMinicondahttps://conda.io/en/latest/miniconda.htmlCommand referencehttps://conda.io/projects/conda/en/latest/commands.htmlManaging environmentshttps://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.htmlCondahttps://github.com/conda/condaConda provides many commands for managing packages and environments. The links on this page provide help for each command. You can also access help from the command line with the--helpflag:conda install --help1. Creating an environment with commandsTo create an environment:conda create --name my-envReplacemy-envwith the name of your environment.When conda asks you to proceed, typey:proceed ([y]/n)?This creates the myenv environment in/envs/. No packages will be installed in this environment.To create an environment with a specific version of Python:conda create -n myenv python3.9To create an environment with a specific package:conda create -n myenv scipyor:conda create -n myenv python conda install -n myenv scipyTo create an environment with a specific version of a package:conda create -n myenv scipy0.17.3or:conda create -n myenv python conda install -n myenv scipy0.17.3To create an environment with a specific version of Python and multiple packages:conda create -n myenv python3.9 scipy0.17.3 astroid babel2. Conda vs. pip vs. virtualenv commandsIf you have used pip and virtualenv in the past, you can use conda to perform all of the same operations. Pip is a package manager and virtualenv is an environment manager. Conda is both.conda activateonly works on conda 4.6 and later versions. For conda versions prior to 4.6, type:Windows:activateLinux and macOS:source activateconda update pythonupdates to the most recent in the series, so any Python 2.x would update to the latest 2.x and any Python 3.x to the latest 3.x.Scroll to the right to see the entire table.scroll [skrəʊl]v. 滚动滚屏 n. 卷轴(石刻或木雕的) 涡卷形装饰conda list - 列出当前虚拟环境的所有包。conda env list - 列出 conda 管理的所有虚拟环境。3. PyCharm 和 conda 虚拟环境连接Setting - Project - Project Interpreter点击齿轮标志再点击 Add Local 为添加某个环境的 python.exe 解释器。在 PyCharm 中将解释器路径修改为D:\Software\Anaconda\envs\learn后可以看到下方的依赖包列表也随之更新为 learn 环境中的包。References[1] Yongqiang Cheng (程永强), https://yongqiang.blog.csdn.net/[2] Conda 常用命令 - PyCharm 和 Conda 虚拟环境连接, https://mp.weixin.qq.com/s/nQJS41zQIS2dDepTD3qtzg