-
Notifications
You must be signed in to change notification settings - Fork 7
Quick Start
PCART Bot edited this page May 11, 2026
·
5 revisions
Get started with PCART in 5 minutes.
- Linux (Ubuntu 18.04.1+) or Windows 11
- Python 3.9+
- dill 0.3.7
- Python 3.x
- dill 0.3.7
- The library you want to upgrade (at current and target versions)
- Project’s requirements.txt
Create two virtual environments for your target project:
# Create environments with current and target versions
conda create -n myproject_v1 python=3.x
conda create -n myproject_v2 python=3.x
# Activate current version environment
conda activate myproject_v1
pip install dill
pip install your-library==1.7.1
# Activate target version environment
conda deactivate
conda activate myproject_v2
pip install dill
pip install your-library==1.9.0Create a JSON file in the Configure/ directory. The runCommand field supports multiple formats:
-
python run.py— standard Python script -
python3 src/main.py— Linux python3 -
py -3.9 train.py— Windows py launcher -
pytest tests/orpython -m pytest tests/— console scripts / module execution
PCART auto-detects the Python executable from your currentEnv/targetEnv. See the Configuration-Guide for all supported formats.
Linux:
{
"projPath": "/home/user/myproject",
"runCommand": "python run.py",
"runFilePath": "",
"libName": "torch",
"currentVersion": "1.7.1",
"targetVersion": "1.9.0",
"currentEnv": "/home/user/anaconda3/envs/myproject_v1",
"targetEnv": "/home/user/anaconda3/envs/myproject_v2"
}Windows:
{
"projPath": "C:\\Users\\user\\myproject",
"runCommand": "python run.py",
"runFilePath": "",
"libName": "torch",
"currentVersion": "1.7.1",
"targetVersion": "1.9.0",
"currentEnv": "C:\\Users\\user\\anaconda3\\envs\\myproject_v1",
"targetEnv": "C:\\Users\\user\\anaconda3\\envs\\myproject_v2"
}# Run detection and repair
python main.py -cfg myproject.json
# If API definitions are missing, extract them first
python extractLibAPI.py -cfg myproject.jsonOn the first run, PCART instruments your project code and runs it in currentEnv to generate pkl files. These pkls capture runtime API call data and are used for dynamic API signature matching. See How-It-Works for details on the pkl lifecycle.
Repair results are saved to Report/runs/{run_id}/{command_id}/ — each run produces an isolated output directory with the repair report and patched source files.
- Configuration-Guide: Learn about all configuration options
- How-It-Works: Understand the pipeline, pkl lifecycle, and matching strategy
- Examples: See real-world usage examples
- Troubleshooting: If you encounter issues