Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA 12: How can I run pip install to install libraries in virtual environment?

I am using IntelliJ IDEA 12 Ultimate Edition and creating flask project.

I created the virtualenv using IDEA and using that, but my code has dependency on other libraires I as move forward. For example Flask-Restless.

My code in IntelliJ IDEA looks like

enter image description here

Is there a way to install Flak-Restless using IntelliJ IDEA 12?

or

do I need to activate my virtualenv on command-line and install it myself?

Is it something IDEA can provide to me?

like image 925
daydreamer Avatar asked Mar 17 '13 16:03

daydreamer


3 Answers

In IntelliJ IDEA use Tools | Manage Python Packages dialog to install/uninstall packages for your Python SDK or virtualenv used in project.

like image 113
Andrey Avatar answered Oct 19 '22 18:10

Andrey


Use pip requirements.txt in your repository root. My PyCharm automatically prompt me install absent requirements or if installed versions not equal with requirements.txt.

You can install packages from requirements.txt:

your_python_root_pip install -r requirements.txt

You can get already installed packages with versions:

your_python_root_pip freeze -r requirements.txt

For details see pip help. See requirements.txt example:

flask==0.9
flask-testing==0.4
blinker==1.2
uwsgi==1.4.5
nose
coverage
pep8
like image 43
tbicr Avatar answered Oct 19 '22 18:10

tbicr


You can install all project packages via PyCharm 2017.1 by Tools / Python Integrated Tools / Package requirements file. Get there full path to your requirements.txt file and PyCharm will ask you to install all dependencies.

like image 1
valex Avatar answered Oct 19 '22 16:10

valex