Configure Pycharm To Use Virtualenv
Configure PyCharm to use virtualenv
Akbar S. Ahmed | Feb 10, 2015

Step-by-step instructions

In this post you’ll learn how to configure PyCharm to use an existing virtual environment.

I enjoy using PyCharm for editing source. However, I prefer to use the command line for everything else. virtualenv is one such tool that I prefer to use on the command line. However, we need to configure PyCharm to use a virtual environment after it has been created on the command line.

This post assumes you have already installed PyCharm and have setup a virtual environment for your Python development.

Prerequisites

Configure PyCharm

  • Select File, click Settings.
  • In the left pane, enter Project Interpreter in the search box, then click Project Interpreter.
  • In the right pane, click the gear icon, click More….
  • In the Project Interpreters dialog box, click the plus sign +, click Add Local.
    • Enter ~/virtualenvs/<your virtualenv name>/bin/python in the path. If you followed the earlier post to setup a virtual environment for Python then enter ~/virtualenvs/api/bin/python.
    • Click OK.
  • Select 2.7.6 virtualenv at ~/virtualenvs/api, click the edit icon.
  • Check Associate this virtual environment with current project.
  • Click OK.
  • Click OK.
  • Click Apply, click OK.

Change the path to the interpreter on Windows.




Subscribe to our newsletter

Contact Information

ABOUT EXPONENTIAL.IO

We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.

LOCATION

All courses are made with love in
Palo Alto, CA.

Subscribe to our newsletter