Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up virtual environment in PyCharm

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".

Can you show me the way i can fix this?

Thanks in advance.

like image 749
Aleksei Yerokhin Avatar asked Aug 25 '13 15:08

Aleksei Yerokhin


1 Answers

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.

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.

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

like image 96
blakev Avatar answered Oct 22 '22 04:10

blakev