This repository provides scripts to set up a Conda environment for FreeCAD development with proper environment variables. It includes Windows (BAT) and Linux/macOS (SH) scripts for seamless configuration.
- Automated Conda environment creation using
freecad-stubs-env.yml - Environment variables (
PYTHONPATH,FREECAD_LIB, etc.) set up automatically - Persistent activation/deactivation scripts (
activate.danddeactivate.d) - Cross-platform support (Windows & Linux/macOS)
- VS Code integration for FreeCAD development
git clone https://github.com/seancairns14/freecad-conda-setup.git
cd freecad-conda-setupEnsure Anaconda or Miniconda is installed.
🔗 Download Miniconda
setup.batchmod +x setup.sh
./setup.shAfter running the setup script, restart your terminal and run:
conda activate freecad-stubs-env && code .You can run freecad by running in the activated terminal:
FreeCADfreecad-conda-setup/
│── create_env/
│ ├── create_env.bat # Windows script to create the Conda environment
│ ├── create_env.sh # Linux/macOS script to create the Conda environment
│── setup.bat # Windows setup script
│── setup.sh # Linux/macOS setup script
│── freecad-stubs-env.yml # Conda environment YAML file
│── README.md # Project documentation
- Creates a Conda environment (
freecad-stubs-env) fromfreecad-stubs-env.yml - Sets up activation/deactivation scripts to configure
PYTHONPATH - Adds FreeCAD paths automatically when activating the environment
- Deactivates and cleans up paths when the environment is exited
Modify freecad-stubs-env.yml to add additional dependencies.
Example (freecad-stubs-env.yml):
name: freecad-stubs-env
dependencies:
- python=3.9
- freecad
- numpy
- pip
- pip:
- freecad-stubsIf you see:
CondaValueError: prefix already exists
Manually remove the environment:
conda remove --name freecad-stubs-env --allThen, rerun the setup script.
Ensure VS Code uses the correct interpreter:
- Open Terminal and activate env:
conda activate freecad-stubs-env - (IMPORTANT) Open VS Code using command:
code . - Ensure that
freecad-stubs-envis selected interpreter
Feel free to submit pull requests or report issues! 🚀
This project is licensed under the MIT License. See LICENSE for details.