Using Pycharm virtualenv with preexisting files
<p>I was sent a bunch of Python files that have various custom dependencies inside nested folders. I used to run the main file from Terminal by first navigating to the main folder, then running <code>python main.py</code>. This worked until I needed to update some modules and ran into permissions problems.</p>

<p>So I downloaded Pycharm and I'm trying to use a virtualenv. I'm stuck though: do I create a new Pycharm project?</p>

<p>Under the project interpreter, I made a new virtualenv with no modules, but when I do <code>pip list</code> in the command window that's below, it lists all my modules.</p>

<p>How can I "import" my existing Python files, put them in a clean virtualenv, and install the modules I need?</p>

<p>In PyCharm, do File -> Open and point at the directory. It will turn that directory into a "project" (meaning, it will create a .idea subdirectory). Depending on how you named your virtualenv, it will likely detect the virtualenv and assign it the project's interpreter.</p>

python pycharm virtualenv