What you need to do right now
RDKit is a chemistry toolkit that runs inside Python, so you install it through your package manager — either conda or pip — depending on which one you used to set up Jupyter in the first place. The conda route is faster and more reliable because RDKit has compiled binaries ready to go. If you used pip to install Jupyter, you can still use conda just for RDKit, or stick with pip and wait longer for the code to compile on your machine.
The whole process takes 5 to 15 minutes depending on your internet speed and which installation method you choose. After installation, you will restart Jupyter and run a test import to confirm it worked.
Key Takeaways
- RDKit installs through conda (faster) or pip (slower but works if you already use pip), not through Jupyter's interface.
- You must stop Jupyter, install RDKit in your terminal or command prompt, then restart Jupyter to use it.
- After installation, test the import by running from rdkit import Chem in a notebook cell to confirm it worked.
- If you get an error after installation, you likely installed RDKit in the wrong Python environment — the one Jupyter is not using.
Installing RDKit with conda (the faster route)
Open your terminal (Mac or Linux) or command prompt (Windows). Type the command exactly as shown and press Enter:
conda install -c conda-forge rdkit
This tells conda to fetch RDKit from the conda-forge channel, which maintains the most up-to-date version. The download and installation will take several minutes. You will see a progress bar and then a confirmation message when it finishes. Do not close the terminal while this runs.
If conda asks you to confirm by typing y and pressing Enter, do that. Once you see the command prompt return (usually a $ or > symbol), the installation is complete.
Installing RDKit with pip (if you do not have conda)
Open your terminal or command prompt and type:
pip install rdkit
This will take longer than conda — usually 10 to 15 minutes — because pip compiles RDKit from source code on your machine rather than downloading a pre-built version. The terminal will show compilation messages and progress. This is normal. Do not interrupt it.
When you see the command prompt return, the installation is done. If the process stops with an error about missing build tools, you may need to install a C++ compiler first. On Windows, download Microsoft C++ Build Tools. On Mac, run xcode-select --install in the terminal, then try the pip command again.
Restarting Jupyter and testing the installation
If Jupyter is currently running, stop it by clicking the terminal window where Jupyter is open and pressing Ctrl+C (or Cmd+C on Mac). Wait for the shutdown message to appear. Then start Jupyter again by typing jupyter notebook in the terminal and pressing Enter.
Once Jupyter opens in your browser, create a new notebook or open an existing one. In the first cell, type this code:
from rdkit import Chem
Press Shift+Enter to run the cell. If the cell runs without showing an error, RDKit is installed correctly. If you see an error like ModuleNotFoundError: No module named 'rdkit', jump to the troubleshooting section below.
Confirming RDKit works with a simple test
After the import runs without error, test that RDKit actually works by running this code in a new cell:
mol = Chem.MolFromSmiles('CCO') print(mol)
This creates a simple molecule (ethanol) from its chemical notation and prints it. You should see output that includes the word Mol and some technical information. If you see that, RDKit is fully functional.
You can now use RDKit in any cell in this notebook. If you create a new notebook later, you will only need to run the from rdkit import Chem line once per notebook session.
Fixing the "ModuleNotFoundError" after installation
This error means Jupyter is running Python from a different location than where you installed RDKit. This happens most often when you have multiple Python installations on your machine.
First, check which Python Jupyter is using. In a notebook cell, run:
import sys print(sys.executable)
This shows the path to the Python installation Jupyter is using. Then, in your terminal, check where conda or pip installed RDKit by running:
conda list rdkit (if you used conda)
or
pip show rdkit (if you used pip)
If the paths do not match, you installed RDKit in the wrong Python environment. The fix is to install it again, but this time specify the exact Python that Jupyter uses. In your terminal, run:
/path/to/python -m pip install rdkit
Replace /path/to/python with the path you found earlier. Then restart Jupyter and try the import again.
Using RDKit in your notebooks going forward
Once RDKit is installed, you do not need to reinstall it. Every time you start a new notebook, add this line to your first cell:
from rdkit import Chem
You can then use RDKit functions like Chem.MolFromSmiles(), Chem.Draw.MolToImage(), and others throughout your notebook. If you want to use RDKit alongside other chemistry tools like pandas or matplotlib, import all of them at the top of your notebook in separate cells or in one cell with multiple import statements.
If you ever update Jupyter or Python, you may need to reinstall RDKit. The same conda or pip command will work — it will either update RDKit to a newer version or confirm that the current version is already installed.
Frequently Asked Questions
Do I need to install RDKit every time I open Jupyter?
No. You install RDKit once on your machine, and it stays installed. Every time you start Jupyter, you just import it in your notebook with from rdkit import Chem. The import statement is what you need in every notebook, not the installation.
Should I use conda or pip?
Use conda if you have it — it is faster and more reliable for RDKit. If you set up Jupyter with pip and do not have conda, stick with pip for RDKit too. Mixing them usually works but can cause conflicts. If you are unsure which you used, type conda --version in your terminal. If it shows a version number, you have conda.
What if the installation seems stuck?
Conda and pip can take a long time on slow internet or older machines. Wait at least 10 minutes before assuming it is stuck. If you see no new messages for 15 minutes, press Ctrl+C to stop it, then try again. If it fails repeatedly, try the other method (conda if you used pip, or vice versa).
Can I use RDKit without Jupyter?
Yes. Once installed, RDKit works in any Python environment — regular Python scripts, IPython, VS Code, or any IDE. The installation process is the same regardless of where you plan to use it.
What if I get a "permission denied" error during installation?
On Mac or Linux, try adding --user to the end of your command: pip install --user rdkit or conda install -c conda-forge rdkit (conda does not need the flag). On Windows, make sure you are not running the terminal in read-only mode — close it and open a new one.