Configure Python IDE Environment - SVF-tools/Software-Security-Analysis GitHub Wiki
1. Prerequisite:
-
- 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
-
- For further using and learning VSCode - Learn to code with VSCode
-
- For further using and learning Pycharm - Learn to code with Pycharm
-
-
Download Docker image according to your environment
docker pull svftools/software-security-analysis:latestwhich can support X86(win, linux, macOS x86) and Arm64 (Mac M1 - M4)
2. Run with VSCode
If you encounter some problem, please check this document Trouble-Shooting-for-IDE.
2.1 Working with VSCode in Docker containers
Install extensions in VSCode
*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

Load Docker container in VSCode
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

Install/Enable Python Debugger extension in container
- 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.

2.2 Run and debug your program
-
VSCode's built-in debugger helps your editing, compilation and debugging.
-
Check that python interpreter should be
/usr/bin/python3. ClickSearch-Show and Run Commands-Python: Select Interperter, and choose/usr/bin/python3, which should be Python 3.10.

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

Switching programs
When working on different labs/assignments, change the "program" and "args" fields in launch.json
| Lab/Assignment | "program" | "args" |
|---|---|---|
| Assignment-1 | "${workspaceFolder}/python/Assignment-1/Python/Main.py" | "-icfg", "Assignment-1/Tests/testcases/icfg/test1.ll" |
| Assignment-2 | "${workspaceFolder}/python/Assignment-2/Python/Main.py" | "Assignment-2/Tests/testcases/sse/test1.ll" |
| Assignment-3 | "${workspaceFolder}/python/Assignment-3/Python/Main.py" | "Assignment-3/Tests/ae/test1.ll" |
3. Run with PyCharm
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).
3.1 Install PyCharm
- Download and install the Community or Professional edition from the official website:
๐ https://www.jetbrains.com/pycharm/download
3.2 Install Required Python Packages
If you're using Linux or macOS, you can install pysvf directly in PyCharm terminal:
python3 -m pip install pysvf -i https://test.pypi.org/simple/
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 Remote Python 3.10.17 Docker(svf-tools/software-security-analysis), the configuration was successful
