title: Using virtualenv with Sublime Text 3 and SublimeREPL
body: <p>I'm trying to setup ST3 to work with Python's virtualenv, running on Windows 8.1. I usually use SublimeREPL with my global Python install to run files. Now that I'm using venvs, though, I'm having trouble getting anything to run. Here's what I've been trying:</p>
  
  <p>I have a parent directory with a folder <code>virtualenvs</code>, then one <code>scripts</code> for my .py files that I muck around with. I usually just navigate to <code>\virtualenvs\venv\scripts\activate</code> and do my work using the python interpreter, but I'd like to be able to build the files without needing to go through command line stuff, using ST3 and SublimeREPL.</p>
  
  <p>I made a build system that looks like this:</p>
  
  <pre><code>{
      "shell_cmd": ["\code\virtualenvs\venv\scripts\python.exe", "-u", "$file"],
      "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
      "selector": "source.python",
  }
  </code></pre>
  
  <p>But I'm not even sure if this is what I need to do to use SublimeREPL, as I've never had to worry about <code>Tools &gt; Build Systems</code> before, just <code>Tools &gt; SublimeREPL &gt; Python &gt; Python - RUN current file</code>. </p>
  
  <p>How can I change the build system or customize SublimeREPL's RUN? For a test case, I have the <code>requests</code> module installed in the venv but not in my global python install. Importing it from command line works fine but a .py file with <code>import requests</code> returns an ImportError.</p>