Python

how to use virtualenv in pycharm

Go to the project folder

enter command:

virtualenv venv

Pycharm setup

Then goto the pycharm project. Open File->Settings->Project->Project Interpreter

Select the ‘venv’ folder.

Now go to Terminal in Pycharm. Run this:

python -c “import sys; print(sys.path)”

If this terminal is using the Default python, not the Virtualenv, then from the terminal run this:

source venv/bin/activate

Now, everything you install from the terminal will be installed in virtualenv.

When Done working, run

deactivate

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s