在PyCharm建立虚拟环境

时间:2022-05-14 12:45:45

Greetings to everyone!

问候大家!

I've got a little issue in a project made by someone in PyCharm, with virtual environment(VE) precisely. I've set this VE up few months ago and didn't use it for some time. Now i need to go back to it, because it has a lot of necessary things installed. Therefore there is one more battery needed to be installed into this VE - it is soundcloud API. I installed by directly from PyCharm in project settings, i checked whether this VE is still a default VE - it is. But project keeps complaining that there is "No module named soundcloud".

我在一个由PyCharm的人制作的项目中遇到了一个小问题。我几个月前就把它设置好了,一段时间没有使用它了。现在我需要回到它,因为它有很多需要安装的东西。因此,需要在这个VE中再安装一个电池——它是soundcloud API。我直接从PyCharm安装在项目设置中,我检查这个VE是否仍然是默认的VE -它是。但是project一直在抱怨“没有名为soundcloud的模块”。

Can you show me the way i can fix this?

你能告诉我怎么修理吗?

Thanks in advance.

提前谢谢。

1 个解决方案

#1


11  

In settings, under the Project section (in the left pane) go to Interpreters. From there you can select a found environment or click the + to add your own from a path. Find the environment you created and add it to the list. Then, once you select the environment you can see the installed modules underneath. You can add new modules through their built in pip.

在设置中,在Project部分(左窗格)下转到解释器。从那里,您可以选择找到的环境或单击+从路径添加您自己的。找到您创建的环境并将其添加到列表中。然后,一旦选择了环境,就可以看到下面安装的模块。您可以通过其内置的pip添加新的模块。

After that, it'll take you to the first page where you have to select your custom environment from a drop down.

之后,它将带您到必须从下拉菜单中选择自定义环境的第一页。

Good luck!

好运!

Edit: Reread your question. Sometimes when I can't get the module to be recognized in PyCharm, I do a pip install through the command line in the virtual environment. Then restart PyCharm.

编辑:重读你的问题。有时,当我无法在PyCharm中识别模块时,我就通过虚拟环境中的命令行进行pip安装。然后重启PyCharm。

Navigate to the environment in cmd and run python -m pip install -U SOUNDCLOUD_MODULE and it'll work.

导航到cmd中的环境并运行python -m pip安装-U SOUNDCLOUD_MODULE,它将会工作。

#1


11  

In settings, under the Project section (in the left pane) go to Interpreters. From there you can select a found environment or click the + to add your own from a path. Find the environment you created and add it to the list. Then, once you select the environment you can see the installed modules underneath. You can add new modules through their built in pip.

在设置中,在Project部分(左窗格)下转到解释器。从那里,您可以选择找到的环境或单击+从路径添加您自己的。找到您创建的环境并将其添加到列表中。然后,一旦选择了环境,就可以看到下面安装的模块。您可以通过其内置的pip添加新的模块。

After that, it'll take you to the first page where you have to select your custom environment from a drop down.

之后,它将带您到必须从下拉菜单中选择自定义环境的第一页。

Good luck!

好运!

Edit: Reread your question. Sometimes when I can't get the module to be recognized in PyCharm, I do a pip install through the command line in the virtual environment. Then restart PyCharm.

编辑:重读你的问题。有时,当我无法在PyCharm中识别模块时,我就通过虚拟环境中的命令行进行pip安装。然后重启PyCharm。

Navigate to the environment in cmd and run python -m pip install -U SOUNDCLOUD_MODULE and it'll work.

导航到cmd中的环境并运行python -m pip安装-U SOUNDCLOUD_MODULE,它将会工作。