简体   繁体   English

使用 PyCharm 终端在 PyCharm conda 环境中安装依赖项

[英]Installing a dependency in PyCharm conda environment using PyCharm terminal

I have created a conda env using conda create env command in PyCharm.我在 PyCharm 中使用conda create env命令创建了一个 conda env。 After running conda activate <env_name> , I can also see the name of the environment in my shell before username in parenthesis.运行conda activate <env_name> ,我还可以在括号中的用户名之前看到我的 shell 中的环境名称。 But when I run pip3 install xxx , it doesn't install in that environment.但是当我运行pip3 install xxx ,它不会安装在那个环境中。 So, I have to go to PyCharm Preference and add that dependency using their user interface and then it works.所以,我必须转到 PyCharm Preference 并使用他们的用户界面添加该依赖项,然后它才能工作。

Wanted to know what mistake am I making that even when the environment is activated in PyCharm terminal, the dependency isn't installing in that environment.想知道我犯了什么错误,即使在 PyCharm 终端中激活了环境,依赖项也没有安装在该环境中。

Default way of installing packages to conda environments is described here: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-packages将软件包安装到 conda 环境的默认方式在此处描述: https : //docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-packages

TLDR: conda install xxx TLDR: conda conda install xxx

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

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