-
Notifications
You must be signed in to change notification settings - Fork 37
Configure Python IDE Environment
-
- To know more about Docker - 12 mins video to understand Docker: YouTube Bilibili
- If you have installation problems on Windows, please refer to windows-docker-problem-solutions
-
And you can choose one IDE below
-
Install VSCode
- For further using and learning VSCode - Learn to code with VSCode
-
Install PyCharm
- For further using and learning Pycharm - Learn to code with Pycharm
-
Install VSCode
-
Download Docker image according to your environment
If you encounter some problem, please check this document Trouble-Shooting-for-IDE.
*To install the extension, open the Extensions view (MAC: ⇧⌘X, Windows: Ctrl+Shift+X, Linux: Ctrl+Shift+X)
- Extension(1): Docker extension
- Search for
dockerto filter results and select Docker extension authored by Microsoft.
- Search for

- Extension(2): Remote Containers extension
- Search for
dev containerto filter results and select extension authored by Microsoft.
- Search for

Right click the container item and select 'Attach Visual Studio Code'

If you can't see the working directory, please select file -> open (folder)... then enter the /home/SVF-tools/Software-Security-Analysis

*To install the extension, open the Extensions view (MAC: ⇧⌘X, Windows: Ctrl+Shift+X, Linux: Ctrl+Shift+X)
Search for Python Debugger and select Docker extension authored by Microsoft.

The labs use Jupyter Notebook, which displays code and output together. First, install the ipykernel package from pip, using your command line of choice (this is required for the VS Code Jupyter extension to work properly):
pip install ipykernel
Search for Jupyter and install the extension pack authored by Microsoft:

-
VSCode's built-in debugger helps your editing, compilation and debugging.
-
Check that the Python interpreter should be
/usr/bin/python3or the virtual environment where you installedpysvf. ClickSearch-Show and Run Commands-Python: Select Interpreter, and choose a Python 3.8-3.12 interpreter.

- Software-Security-Analysis has prepared configurations in
launch.jsonin.vscodefolder to debug test.py in${workspaceFolder}/Assignment-1/Pythonfolder.

When working on different labs/assignments, change the "program" and "args" fields in launch.json
| Lab/Assignment | "program" | "args" |
|---|---|---|
| Assignment-1 | "${workspaceFolder}/Assignment-1/Python/test.py" | "-icfg", "Assignment-1/Tests/testcases/icfg/test1.ll" "-pta", "Assignment-1/Tests/testcases/pta/test1.ll" "-taint", "Assignment-1/Tests/testcases/taint/test1.ll" |
| Assignment-2 | "${workspaceFolder}/Assignment-2/Python/test-sse.py" | "Assignment-2/Tests/testcases/sse/test1.ll" |
| Assignment-3 | "${workspaceFolder}/Assignment-3/Python/test-ae.py" | "Assignment-3/Tests/stmt.ll" "Assignment-3/Tests/buf_overflow.ll" "Assignment-3/Tests/null_deref.ll" |
PyCharm is a powerful Python IDE. This section explains how to set up your project and work with pysvf using PyCharm on Linux/macOS and Windows (via Docker).
- Download and install the Community or Professional edition from the official website:
👉 https://www.jetbrains.com/pycharm/download
If you're using Linux or macOS, you can install pysvf directly in PyCharm terminal:
python3 -m pip install pysvf
For Windows users, follow these steps to configure PyCharm with Docker:
-
Navigate to File > Settings > Project > Python Interpreter
-
Click Add Interpreter and select On Docker

-
Select Pull or use existing, enter svf-tools/software-security-analysis in the Image tag field, then click Next

-
If no errors appear in the output field, click Next

-
Click Create to finish the setup

-
Return to the Python Interpreter settings. If you see a remote Python interpreter from
svf-tools/software-security-analysis, the configuration was successful