-
Notifications
You must be signed in to change notification settings - Fork 9
How to install PyChrono
This guide walks you through the installation of PyChrono for use in this project.
Follow the official Miniconda installation guide for your platform (Windows, macOS, or Linux).
-
Download the file
install/install_pychrono_windows.txt
. -
Rename it to
install/install_pychrono_windows.bat
. -
Open Command Prompt and run:
install_pychrono_windows.bat
-
β‘οΈ Skip to Step 5: Copy the Demos and Test the Installation
-
Download the file
install/install_pychrono_linux.sh
. -
Open a terminal and make the script executable:
chmod +x install_pychrono_linux.sh
-
Run the script:
./install_pychrono_linux.sh
-
β‘οΈ Skip to Step 6: Run the Code
-
Download the file
install/install_pychrono_macos.sh
. -
Open a terminal and make the script executable:
chmod +x install_pychrono_macos.sh
-
Run the script:
./install_pychrono_macos.sh
-
Initialize Conda for zsh shell
/opt/miniconda3/bin/conda init zsh
-
Restart the shell
exec zsh
-
Activate the PyChrono Conda environment
conda activate chrono
-
Set the PYTHONPATH environment variable
export PYTHONPATH=$(conda info --base)/envs/chrono/share/chrono/python
-
β‘οΈ Skip to Step 6: Run the Code
Note
Steps 4-7 need to be run every time you want to use pychrono.
Open a terminal (Windows users: use PowerShell or Anaconda Prompt):
conda config --add channels http://conda.anaconda.org/conda-forge
conda create -n chrono python=3.10
Activate the environment:
conda activate chrono
To deactivate:
conda deactivate
Stay in the environment during the following steps.
conda install -c conda-forge numpy=1.24.0
conda install -c conda-forge matplotlib
conda install -c conda-forge irrlicht=1.8.5
conda install -c conda-forge pytz
conda install -c conda-forge scipy
Visit the package repo and download the correct version for your platform:
-
macOS:
osx-arm64/pychrono-8.0.0-py310_2471.tar.bz2
-
Windows:
win-64/pychrono-8.0.0-py310_0.tar.bz2
-
Linux:
linux-64/pychrono-8.0.0-py310_0.tar.bz2
After downloading, navigate to the folder (e.g., Downloads) and run:
cd ~/Downloads
conda install pychrono-8.0.0-py310_2471.tar.bz2
Note
macOS users: You may also need to set the PYTHONPATH
:
export PYTHONPATH=$HOME/miniconda3/envs/chrono/share/chrono/python
-
Navigate to the folder where you want to save the demo files:
mkdir ~/pychrono_demos cd ~/pychrono_demos
-
Copy the demo files:
cp -r $PYTHONPATH/pychrono/demos/* .
-
Run a demo to verify the installation:
cd mbs python demo_MBS_revolute.py
-
Clone the repository:
git clone https://github.com/andrealaffly/UAV_Sim_PyChrono.git cd UAV_Sim_PyChrono
-
Run the simulation:
python main.py
UAV_Sim_PyChrono β A PyChrono-based high-fidelity simulator for UAVs
Developed by Mattia Gramuglia and Andrea L'Afflitto