Stage 0 — What Exactly Is PyBullet?
PyBullet is a Python interface for the Bullet Physics SDK.
In other words, the core Bullet engine is written in C/C++, and PyBullet allows us to work with it through Python.
According to the official documentation, PyBullet can be used for applications such as:
- Physics simulation
- Robotics
- Reinforcement Learning
- Collision detection
- Forward Dynamics
- Inverse Dynamics
- Forward Kinematics
- Inverse Kinematics
- URDF
- SDF
- MJCF
So when we write:
import pybullet
we are actually importing a Python library that has the Bullet physics engine behind it.
1️⃣ Official PyBullet Source
The official and primary repository is available on GitHub:
Bullet Physics GitHub Repository
How do we know that this is the official Bullet repository?
There are several reasons:
- Organization Name: The repository is hosted under the
bulletphysicsorganization on GitHub, indicating that it belongs to the official project organization. - Official Repository Statement: The repository’s README explicitly states: “This is the official repository of Bullet.”
- Project Description: The repository description is consistent with the official description of Bullet as a real-time collision detection and physics simulation SDK used in areas such as VR, games, and robotics.
- Official Website: The repository references the project’s official website at
http://bulletphysics.org.
Therefore, you can confidently use this repository to access and study the source code of the Bullet Physics SDK.
2️⃣ Does Windows Support PyBullet?
The official Bullet repository on GitHub states in its README that Bullet has been tested on:
- Windows
- Linux
- macOS
- iOS
- Android
The repository also presents:
pip install pybullet
as the recommended way to install PyBullet.
Therefore:
Yes, PyBullet is supported on Windows.
3️⃣ PyBullet Version
What exactly do I need to install Bullet Physics, or PyBullet as we call it in this course, and why?
Depending on whether you want to use Bullet through Python or work directly with C++, there are two different paths.
🟢 Path 1: Using PyBullet with Python
Recommended for beginners and for this course
This method is suitable for most users working with:
- Robotics
- Machine Learning
- Physics Simulation
- Reinforcement Learning
What do you need?
- Python — version 3.6 or later
- pip — Python’s package manager, which is normally installed with Python
- An Internet connection — to download the package
Installation command
pip install pybullet
Why don’t you need anything else?
Because with this command:
- The appropriate Wheel file for your system is downloaded and installed automatically.
- The Wheel contains the required precompiled C++ code as well as the Python interface.
- You normally do not need any of the following:
- A C++ compiler
- CMake
- Additional libraries
🔵 Path 2: Using Bullet Directly with C++
If you want to use the physics engine directly inside a C++ project—for example, when developing a game or an advanced simulator—the installation process is different.
What do you need?
| Requirement | Purpose |
|---|---|
| C++ Compiler such as GCC on Linux, MSVC on Windows, or Clang on macOS | Compiles C++ source code into machine code that can run on your system |
| CMake version 3.10 or later | Manages the project’s build process and helps configure the library for your operating system and compiler |
| Git — optional but recommended | Allows you to obtain the source code directly from the official repository |
| Graphics Libraries — optional | Libraries such as OpenGL or GLFW may be required for running graphical demos |
Why is this approach more complicated?
This approach gives you full control over compilation settings and optimizations.
In this case, you are essentially building the engine yourself for your specific system, allowing you to use its capabilities directly within your C++ applications.
📊 Final Comparison
| Feature | Python Path (PyBullet) | Direct C++ Path |
|---|---|---|
| Prerequisites | Python and pip | Compiler, CMake, Git |
| Installation Time | A few seconds | Several minutes to around half an hour |
| Manual Compilation Required? | No — uses a Wheel | Yes — manual compilation |
| Suitable For | Rapid simulation, robotics, machine learning | Game development and professional C++ projects |
| Difficulty Level | Very easy | Intermediate to advanced |
But What Exactly Is a Wheel?
You may be wondering:
What is a Wheel, anyway?
Let’s use an analogy.
Imagine that you have a cake recipe written in French—this represents the C++ source code—and you want to bake the cake at home, on your own system.
Case 1: Without a Wheel
- You have to translate the recipe from French into a language your system can understand. This represents compilation.
- For this, you need a translator, which represents the C++ compiler.
- If the recipe is long and complicated, this process may take several minutes to half an hour.
- If there is an error during translation, your cake may fail—just like a compilation error.
Case 2: With a Wheel
- Someone else—the Bullet developers—has already prepared and translated the recipe for your type of oven.
- For example, if you have a gas oven, representing a Windows 64-bit system, a prebuilt version has already been prepared for that environment.
- This ready-to-use package is placed inside a box, represented by the
.whlfile, and published in the package repository, such as PyPI. - When you run:
pip install pybullet
you simply download the box, unpack it, and use the prebuilt package as it is.
- The process usually takes only a few seconds, and you do not need to perform the compilation yourself.
Summary of the Wheel Concept
| Without a Wheel | With a Wheel |
|---|---|
| You must compile the C++ code on your own system. | You use precompiled code. |
| You need a compiler and build tools such as CMake. | You normally do not need a compiler or CMake. |
| Installation can take several minutes to half an hour and may involve compilation errors. | Installation is usually much faster and avoids local compilation. |
So far, we have learned that to use PyBullet with Python, we need Python and, when a compatible Wheel is available, a prebuilt binary package. When you run
pip install pybullet:
pipchecks information about your environment.- It looks for a compatible package.
- It downloads and installs the appropriate package.
As the user, you do not normally need to manage this process manually. You simply run the installation command.
An Important Question: Which Python Version Is Suitable?
At this point, we need to use the official PyBullet distribution source, namely PyPI and its published release files.
For this course, we initially considered Python 3.11 64-bit as a reference environment because the official PyPI page for PyBullet 3.2.7 shows Wheel releases for CPython 3.11.
However, there is an important detail:
The presence of
cp311by itself does not guarantee that a Windows installation will work without Build Tools. We must also check whether a compatible Windows Wheel is actually available for the specific Python and platform combination.
If you are using Windows 64-bit, the first step should be to try installing PyBullet with pip:
py -m pip install pybullet
If the installation succeeds, you are done and can start using PyBullet.
However, if pip produces an error such as:
Microsoft Visual C++ 14.0 or greater is required
or:
Could not find a version that satisfies the requirement pybullet
or you see an error related to:
build / compilation
this usually means that pip could not find a suitable prebuilt Windows Wheel for the package/environment it selected and therefore attempted to build PyBullet from source.
In that situation, you can either:
- Install the required C++ Build Tools and build PyBullet from source, or
- Use a prebuilt distribution such as Conda.
For this course, we choose the second approach.
Why Do We Use Anaconda?
Instead of getting involved with C++ compiler installation and manual compilation, we will use Anaconda/Conda.
For our Windows-based course environment, the combination:
Conda
+
Python 3.12
+
conda-forge
+
PyBullet
provides a convenient installation path because conda-forge provides Windows win-64 builds of PyBullet for supported Python versions.
But what exactly does that statement mean?
Let’s examine the official PyBullet package page on Anaconda:
On that page, there is a Supported Platforms section, where win-64 is listed.
The page also provides an installation command:
conda install conda-forge::pybullet
However, if we want to investigate the available builds in more detail, we should open the Files section of the same page.
There we can find files such as:
win-64/pybullet-3.25-py312h3d6c809_5.conda
The Platform column shows:
win-64
This provides direct evidence that a Windows 64-bit build exists for that Python version/build combination.
What Does win-64/pybullet-3.25-py312... Mean?
If you understand this filename, you will understand a large part of the package compatibility system.
Consider:
win-64/pybullet-3.25-py312h3d6c809_5.conda
Let’s read it from left to right.
Part 1
win-64/
This means:
This package is built for Windows 64-bit.
Part 2
pybullet-3.25
This indicates:
Package name: PyBullet
Package version: 3.25
Part 3
py312
This indicates:
This build was created for Python 3.12.
Therefore, the overall filename approximately communicates:
PyBullet 3.25, built for Python 3.12 on Windows 64-bit.
The same page can also contain builds such as:
win-64/pybullet-3.25-py310...
win-64/pybullet-3.25-py311...
win-64/pybullet-3.25-py312...
win-64/pybullet-3.25-py313...
win-64/pybullet-3.25-py314...
These builds correspond to different Python versions.
Therefore, when we say:
“conda-forge provides a PyBullet package for Windows 64-bit and Python 3.12,”
we are not guessing.
We are looking at evidence such as:
win-64/pybullet-3.25-py312...
What Exactly Is conda-forge?
This is another concept we need to understand clearly.
There are three different things that you should not confuse with each other:
Anaconda
Anaconda is a Python distribution and ecosystem that provides tools for managing Python environments and packages.
Conda
Conda is the package and environment manager.
For example:
conda create ...
creates an environment, while:
conda install ...
installs packages.
conda-forge
conda-forge is a large community-maintained Conda channel containing packages for the Conda ecosystem.
Therefore, when we write:
conda install conda-forge::pybullet
we are essentially telling Conda:
“Find and install the PyBullet package from the channel named
conda-forge.”
The PyBullet package page on Anaconda provides this installation command.
How Do I Know Which Python Version My Anaconda Environment Uses?
The more precise question is:
Which Python version does my current Anaconda environment use?
Conda can have multiple environments, and each environment can have a different Python version.
For example:
Anaconda
│
├── base
│ └── Python 3.12
│
├── pybullet
│ └── Python 3.12
│
└── robotics
└── Python 3.11
This is one of the main reasons we create a separate environment for PyBullet.
Step 1 — Open Anaconda Prompt
Search for:
Anaconda Prompt
in the Windows Start menu.
When it opens, you will usually see something similar to:
(base) C:\Users\YourName>
base means that you are currently inside Anaconda’s main environment.
Step 2 — Check the Python Version
Run:
python --version
For example, if the output is:
Python 3.12.7
that means:
The Python version inside the current Anaconda environment is 3.12.7.
Step 3 — Confirm That Python Belongs to Anaconda
Run:
where python
For example, you might see:
C:\Users\YourName\anaconda3\python.exe
This indicates that the Python executable currently being used belongs to Anaconda.
Now Let’s Move to the Actual Installation
Important educational notes before starting the PyBullet installation with Anaconda
When you install Anaconda, PyBullet is not automatically installed with it.
For example, you might have:
Anaconda
└── base
└── Python 3.10
but no PyBullet installation.
Then you can run:
conda install conda-forge::pybullet
Conda will look for a package compatible with the current environment.
If My Anaconda Environment Is Old, Do I Need to Manually Download PyBullet from the Files Section?
No.
You do not need to visit the Conda package website and manually download a file.
The files listed on the website are mainly useful for understanding which builds have actually been published.
For normal installation, Conda should handle the selection automatically.
For example, if your environment uses Python 3.10:
OS = Windows 64-bit
Python = 3.10
and you run:
conda install conda-forge::pybullet
the Conda Solver examines the specifications of your environment and selects a compatible package from the available builds.
In other words:
If I have Python 3.10, Conda can select a PyBullet build compatible with Python 3.10, provided such a build is available and compatible with the rest of the environment.
Can I Update My Anaconda Python Version So I Can Install the Latest PyBullet?
Yes.
Conda manages Python as a package, so Python can be updated or a specific version can be installed.
For example:
conda update python
or you can request a specific version:
conda install python=3.12
However, this is not always recommended.
The reason is that you may already have projects using different Python versions in different environments.
The professional approach is to keep projects isolated:
base
Python X
│
├── project1
│ Python 3.10
│
├── project2
│ Python 3.11
│
└── pybullet
Python 3.12
This way, changing the Python version for one project does not require changing the entire system.
A — The Correct Approach
The correct approach is to create a new Conda environment and install a suitable Python version inside it.
Then we can check the available PyBullet builds and determine which Python versions are supported.
For example, if we find a build such as:
win-64/pybullet-3.25-py314hcfc7f4e_5.conda
this indicates that a Windows 64-bit build exists for Python 3.14.
We could then create a separate environment with Python 3.14 and install PyBullet there.
However, the newest supported Python version is not automatically the best version for an entire educational course.
We must consider compatibility with all the other libraries we may use.
Can Changing Python in One Environment Affect Other Environments?
No, as long as the environments are separate.
This is one of the most important advantages of Conda.
For example:
Environment A
Python 3.10
PyBullet 3.25
and:
Environment B
Python 3.12
PyBullet 3.25
can both exist on the same computer.
This means you can have different Python/PyBullet environments side by side.
For example:
Environment A
Python 3.10
PyBullet 3.25
and:
Environment B
Python 3.12
PyBullet 3.25
Or, if a newer PyBullet release becomes available in the future, you can create another environment for it.
B — We Can Ask Conda Instead of Visiting the Website
Instead of manually visiting the package website, we can also use the Anaconda Prompt to ask Conda which PyBullet builds are available.
Step 1 — See Which Python Versions Have PyBullet Builds
In Anaconda Prompt, run:
conda search -c conda-forge pybullet
Because your system is Windows, conda search normally searches for packages appropriate for the current platform.
However, I prefer to explicitly specify Windows 64-bit:
conda search -c conda-forge "pybullet[subdir=win-64]"
For example, you may see a result such as:
pybullet 3.25 py311h3e17986_5 conda-forge
This indicates that a PyBullet 3.25 build exists for Python 3.11.
Step 2 — Choose the Best Version for the Entire Course
At this point, we should not look only at PyBullet.
We also need to consider compatibility with the other tools and libraries that we are likely to use throughout the course:
Python
├── PyBullet
├── NumPy
├── SciPy
├── OpenCV
├── Matplotlib
├── Gymnasium
├── Stable-Baselines3
└── PyTorch
In other words:
Python 3.14 is not necessarily the best educational choice simply because it is the newest Python version supported by a PyBullet build.
For the course, we want a Python version that provides a stable and well-supported robotics ecosystem with as few compatibility problems as possible.
Step 3 — Create a Dedicated Environment
For example, if after checking compatibility we decide that Python 3.12 is the most suitable choice:
conda create -n pybullet python=3.12
Then activate it:
conda activate pybullet
Check the version:
python --version
You should see something like:
Python 3.12.x
Step 4 — Install PyBullet Inside the Same Environment
Run:
conda install -c conda-forge pybullet
or the more explicit form:
conda install conda-forge::pybullet
Then test the installation:
python -c "import pybullet; print(pybullet.__version__)"
Our Goal: A Completely Separate PyBullet Environment
We want to create a completely separate environment dedicated to PyBullet.
Let’s assume that, for this course, we have selected:
Windows 64-bit
Python 3.12
PyBullet
because conda-forge provides a corresponding build such as:
win-64/pybullet-3.25-py312...
Step 1 — Open Anaconda Prompt
Open Anaconda Prompt.
You should see something similar to:
(base) C:\Users\YourName>
Step 2 — Check the Current Python
Run:
python --version
For example:
Python 3.12.x
Then:
where python
This allows us to confirm where the current Python executable comes from.
Step 3 — Create a New Environment
Now run:
conda create -n pybullet python=3.12
Here we are telling Conda:
create
↓
Create an environment
-n pybullet
↓
Name it pybullet
python=3.12
↓
Install Python 3.12 inside it
Conda may ask:
Proceed ([y]/n)?
Type:
y
and press Enter.
Step 4 — Activate the Environment
After the installation finishes:
conda activate pybullet
The beginning of the command line should now change to:
(pybullet)
For example:
(pybullet) C:\Users\YourName>
This means:
You are now inside the dedicated PyBullet environment.
Step 5 — Make Sure the Correct Python Is Active
Run:
python --version
You should see:
Python 3.12.x
Then run:
where python
You should see a path similar to:
...\anaconda3\envs\pybullet\python.exe
This means that the Python we are using is no longer the system Python or an unrelated Python installation.
Instead, the structure is:
Anaconda
↓
pybullet Environment
↓
Python 3.12
Step 6 — Install PyBullet
Now that we are inside the environment, run:
conda install conda-forge::pybullet
This is the installation command provided by the PyBullet package page on Anaconda/conda-forge.
Conda will find a compatible package for the environment.
Therefore:
We should not manually download the
py312file.
Conda handles the package selection for us.
Step 7 — How Does Conda Know Which File to Select?
This part is very important.
Your environment has:
Windows 64-bit
Python 3.12
and conda-forge has a corresponding build such as:
win-64/pybullet-3.25-py312...
Therefore, the Conda Solver can select a package that matches the specifications of your environment.
You do not need to type the full filename:
pybullet-3.25-py312h3d6c809_5.conda
You simply run:
conda install conda-forge::pybullet
Step 8 — Verify That PyBullet Was Installed
After the installation finishes, run:
python -c "import pybullet; print(pybullet.__version__)"
If you see a version such as:
3.25
it means that PyBullet has been installed successfully.
Step 9 — Perform a More Realistic Test
Run:
python -c "import pybullet as p; print(p.connect(p.DIRECT)); p.disconnect()"
If the output is:
0
this means that Python successfully loaded PyBullet and connected to the Physics Server.
The Complete Installation Workflow for This Course
We can summarize the workflow as follows:
Anaconda Prompt
↓
Check Python
python --version
↓
Create Environment
conda create -n pybullet python=3.12
↓
Activate Environment
conda activate pybullet
↓
Check Python
python --version
↓
Install PyBullet
conda install conda-forge::pybullet
↓
Test
import pybullet
Most importantly, when a student asks:
“Why are we using Python 3.12?”
the answer should not simply be:
“Because PyBullet requires Python 3.12.”
Instead, the technically accurate answer is:
“At the time this course was prepared, conda-forge provided a Windows
win-64PyBullet build for Python 3.12, identified by thepy312build tag. We therefore selected this combination as the reference environment for the course.”
This is a precise and defensible technical explanation.
What Does cp311 Mean?
This is another concept that we need to teach carefully.
For example, you may see a filename such as:
pybullet-3.2.7-cp311-cp311-...
The part:
cp311
means:
CPython 3.11
Similarly:
cp310
means:
CPython 3.10
So whenever you see:
cp311
you should immediately understand:
This file was built for Python 3.11 / CPython 3.11.
This is particularly important for Python libraries that contain native or binary components.
An Important Note About the Current PyBullet Version
In the current PyPI release of PyBullet 3.2.7, the Wheel files visible on PyPI include builds for different Python versions on Linux, but the current PyPI page does not necessarily present every Windows/Python combination in a simple table.
By contrast, conda-forge provides Windows win-64 builds of PyBullet 3.25 for multiple Python versions, including:
Python 3.10
Python 3.11
Python 3.12
Python 3.13
Python 3.14
Therefore, for our course, we should not simply assume:
“You must install Python 3.11.”
Instead, we should learn to evaluate:
Python version + PyBullet version + installation method
together.
Step 3 — First, Check Your Current Python Version
Since you are using Windows, open:
CMD
Press:
Win + R
Type:
cmd
and press Enter.
Now run:
python --version
or:
python -V
For example, you might get:
Python 3.12.4
or:
Python 3.13.5
Step 4 — A More Detailed Python Check
Run:
python
You may see something similar to:
Python 3.12.4 ... [MSC v.1938 64 bit (AMD64)] on win32
>>>
Several important pieces of information can be identified here.
For example:
Python 3.12.4
means that the Python version is 3.12.4.
And:
64 bit
means that the Python installation is 64-bit.
To exit Python, type:
exit()
Step 5 — Find Out Exactly Which Python Is Being Used
Run:
where python
This is a very important command.
For example, you might see:
C:\Users\YourName\AppData\Local\Programs\Python\Python312\python.exe
Or you might see multiple paths:
C:\Users\YourName\anaconda3\python.exe
C:\Users\YourName\AppData\Local\Programs\Python\Python312\python.exe
If you have multiple Python installations, this can cause confusion when working with PyCharm and installing Python packages.
Step 6 — What Is pip?
Now we will learn one of the most important concepts in this course.
Python itself is a programming language.
However, PyBullet is not part of the Python standard library.
Python packages are commonly installed using pip, the Python package installer.
For example:
pip install pybullet
means:
“pip, download and install PyBullet.”
However, for this course, I prefer the more explicit form:
python -m pip install pybullet
Why?
Because if you have multiple Python installations on your computer:
python -m pip
makes it clear that you are using the pip associated with the same Python interpreter that is being executed by the python command.
Step 7 — Check pip Before Installing PyBullet
First run:
python -m pip --version
For example:
pip 25.x from C:\...\Python312\Lib\site-packages\pip
This output can even help you determine which Python installation the pip command belongs to.
Step 8 — Upgrade pip
Now run:
python -m pip install --upgrade pip
Wait for the command to finish.
If you see something similar to:
Successfully installed ...
then the upgrade completed successfully.
Step 9 — Install PyBullet
Now we reach the main installation step.
Run:
python -m pip install pybullet
The official Bullet documentation also presents pip as a simple way to install PyBullet.
If everything is compatible, the installation should complete successfully.
Step 10 — Verify the Installation
Run:
python -m pip show pybullet
You should see information similar to:
Name: pybullet
Version: 3.2.7
...
Step 11 — The Most Important Test
Now type:
python
Inside the Python interpreter, run:
import pybullet
If no error appears:
PyBullet has been successfully installed.
You can then run:
print(pybullet.__version__)
If the version is displayed, it means that the library is actually available to your Python environment.
Step 12 — Your First Graphical Test
After the installation succeeds, create a file named:
test_pybullet.py
Put the following code inside it:
import pybullet as p
import time
physicsClient = p.connect(p.GUI)
while True:
p.stepSimulation()
time.sleep(1 / 240)
Run the file.
If a PyBullet GUI window opens, it means the following chain is working:
Python
↓
PyBullet
↓
Bullet Physics
↓
GUI
Everything is communicating correctly.