When building a development environment with Python, I think that many people use virtualenv so as not to pollute the base Python environment. Compared to that, I think that the number of users is small, but in fact, virtualenv can be used easily even with the Python plug-in of IntelliJ IDEA, so I will introduce it.
The environment used for this creation is as follows. It seems that it also supports venv, which became a standard function in Python 3.3. I'm trying without putting virtualenv in advance.
First, create a new project as a trial. The module is of course Python.
Next, on the Configure SDK screen, select Python SDK
→Create Virtual Env ...
from the + button on the upper left.
In the Create Virtual Environment dialog, select the virtualenv name and destination, and the base Python SDK. A python 3.3.3 virtual environment has been created in a folder called venv-33.
After that, if you select the created virtual environment and proceed to the next step and complete the wizard, you will be able to develop in the virtual environment you just created.
Now that we need SQLAlchemy, let's put it in.
Write ʻimport sqlalchemy, press Alt + Enter, and select ʻInstall package sqlalchemy
to install the module.
Installation is complete. Of course, SQLAlchemy will be installed in the virtual environment you created earlier.
It's convenient to be able to easily create a virtual environment with virtualenv!
For more information on PyCharm, see also PyCharm Help (http://www.jetbrains.com/pycharm/webhelp/creating-virtual-environment.html). It is also possible to use the existing virtualenv environment. For PyCharm, see Adding Existing Virtual Environment.
Recommended Posts