Download the PyCharm installer from the JetBrains download page. The free "Community Edition" is sufficient for PolySwarm development. Once you've downloaded the installer, follow the instructions for your operating system to install it.
For these instructions, we assume that you've already created your project directory using cookiecutter on our participant-template.
So, we will use the same engine directory name from those instructions (
Follow the steps in the PyCharm documentation for Creating projects from existing source code to create your project.
When you need to select the directory with your source code, select the
Now that you have a PyCharm project created, we can configure the settings.
In the left frame of the PyCharm window, it has the name of your project directory.
Click on the arrow to expand the file listing.
Then, right-click on the
src dir and select
Mark Directory as, then select
Next, we need to set your Python Interpreter for this project.
- In the
Filemenu, select the
- In the
Project: microengine-eicarand then
- In the right frame is where you can configure your project interpreter.
- Click the gear icon to the right of the project interpreter box.
- In the
Add Python Interpreterwindow, make sure
Python Virtual Environmentis selected in the left frame.
- In the right frame, select the
Existing environmentradio button.
- Then click the 3-dots icon next to the
Interpreterbox. This will open a window where you can browse to find your virtual environment.
- Browse to find the
polyswarmvenvvirtual environment that you made during the development environment setup.
- In there, you need to select
binand then select
pythonand then you can click the
Okbutton on each window to save your choices.
Now that your project is configured, you may be prompted by a pop-up to "Install requirements". When asked, select the option to install the requirements.
What this is doing is automatically examining your
requirements.txt file and comparing the Python packages listed in that file with the Python packages that are already installed in your virtual environment.
If any are missing, it will prompt you to install them.
You should now have a PyCharm development environment ready for microengine development.