title: How to create a virtual environment for Django in Pycharm?
body: <p>Currently, I am developing a Django web app in a virtual environment but when I try to edit the web app it just seems that the libraries that I installed in the virtual environment are not found. This is the scenario I have:</p>
  
  <ol>
  <li><p>I installed a virtual environment in <code>C:\Users\myUser\PycharmProjects</code>.</p>
  
  <pre><code>mkdir virtualenvs ; cd virtualenvs
  python -m venv virtualenvs
  </code></pre></li>
  <li><p>I got access to the new folder, activated the virtual environment, upgrading pip and started installing the libraries I need for my project.</p>
  
  <pre><code>cd C:\Users\myUser\PycharmProjects\virtualenvs\virtualenvs\Scripts ; .\activate
  (virtualenvs) python -m pip install --upgrade pip 
  (virtualenvs) pip install django djangorestframework pandas numpy requests
  </code></pre></li>
  <li><p>I go back to <code>C:\Users\myUser\PycharmProjects</code> to create my new Django project (I am still inside of my virtualenvs).</p>
  
  <pre><code>(virtualenvs) mkdir C:\Users\myUser\PycharmProjects\apps ; cd C:\Users\myUser\PycharmProjects\apps
  (virtualenvs) django-admin.exe startproject app1
  (virtualenvs) python manage.py startapp web_app_navigator
  (virtualenvs) python manage.py runserver
  </code></pre></li>
  <li><p>I am able to see the Django successful message <code>The install worked successfully! Congratulations!</code>, but when I open this new application in PyCharm to do some changes such as trying to import any library that I installed I get an error message that the library is not found.</p></li>
  </ol>
  
  <p>My guess is that the virtualenvs and app folder is in some way disconnected from the Pycharm editor, so this might be the reason why PyCharm cannot find the libraries I installed. The easy solution should be to avoid using the virtual environment and just download the libraries but I am against this idea because I want to maintain each Django web app separated with its own libraries. </p>
  
  <p>Did I miss any step such as connecting the app folder with the virtual environment folder? How can I make the virtual environment to work correctly in Pycharm? Any comment, suggestion or improvement to this question is greatly appreciated. </p>