PyROOT and PyCharm

Hi everyone,

Do anybody uses PyCharm with ROOT? I’m trying to make them work together but there is still

ROOT and python are installed via Homebrew, ROOT importing is working in terminal python, PyCharm uses the same interpreter as the terminal python, default PyCharm shell is bash and ~/.bash_profile contains

Has anybody faced this problem and solved it? Or any other ideas how to make it work?

OS version: El Capitan 10.11.3, ROOT version: 5.34.34

1 Like


is the PYTHONPATH correctly set from within the IDE?
And the PATH? (os.system(“root -q”) to test this)


Thank you ))
I added
to the Project Structure and it worked.


is the PYTHONPATH correctly set from within the IDE?
And the PATH? (os.system(“root -q”) to test this)


i use pycharm, conda with root. Adding root to the project structure is not a very good way to do it.

To make root available to pycharm, you need to make pycharm see both the root’s python modules (under $ROOTSYS/lib/.py), as well as the root’s libraries (under $ROOTSYS/lib/.so").

To achieve these you need to set both the project path, and the LD_LIBRARY_PATH env for pycharm, respectively.

To do the first part, check out this link:

To do the second part, open up the pycharm start up script. for me it is under


it is a shell script, not the python wrapper on top it (which also named

add the needed env variables in the shell script, my script for pyroot looks like this:

# ---------------------------------------------------------------------
# PyCharm startup script.
# ---------------------------------------------------------------------

# ROOT env
export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
export PYTHONSTARTUP=$HOME/.pythonstartup

  TITLE="Cannot start PyCharm"

Hi i have a ubuntu 18.04 I install pycharm CE with appstore of ubuntu and I can not change my (which is in read only in /snap/… ) Can you help me I am new in this kind of things

pierre you can always copy the shell script to your $HOME, make changes, and execute your local script instead of the one under /snap