python: ImportError: No module named pytz
<p>I'm working in a virtual environment. In terminal, I can do:</p>

<pre><code>&gt;&gt;&gt; from pytz import timezone
</code></pre>

<p>without issue. However, when I try to run the same code from a python file, I get:</p>

<pre><code>ImportError: No module named pytz
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "/Users/&lt;user&gt;/Desktop/&lt;project folder&gt;/&lt;python file&gt;.py"]
[dir: /Users/&lt;user&gt;/Desktop/&lt;project folder&gt;]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
</code></pre>

<p>Since I'm working in a virtual environment, why isn't it finding the pytz module? It seems like it's only looking in the usr/bin, /bin, etc folders. I even installed it like this outside my virtual environment:</p>

<pre><code>pip install -U pytz
</code></pre>

<p>Not sure if it matters, but I don't have any shebangs in my python file.</p>