oTree Forum >

Package requirements (psycopg2, sentry-sdk, etc.) error

#1 by Tanmoy

HI,

I am using PyCharm version 2025.2.1.1, oTree version 5.11.4, and Python 3.13. Everything was working fine until I suddenly encountered the following issue:

Package requirements 'otree==5.10.4', 'psycopg2>=2.8.4', 'sentry-sdk>=0.7.9' are not satisfied.

I tried the following solutions, but none of them worked:

1. Clicking "Sync Project" in PyCharm.
2. Running:
pip install otree==5.10.4 psycopg2>=2.8.4 sentry-sdk>=0.7.9 - the installation completed successfully, but the issue persisted.
3. Changing the Python interpreter to version 3.12.

Interestingly, the code runs fine, and oTree sessions work without any issues. However, in the __init__.py file, everything is underlined with redlines in PyCharm. Classes and syntax such as models, BaseConstants, BasePlayers, etc., are all marked as errors.

Any help would be appreciated. Thank you in advance.

#2 by Chris_oTree

My guess is that PyCharm and your command line are using 2 separate interpreters, so PyCharm doesn't see the packages you installed. Check if you have separate versions of python installed, and if so what path they are installed to.

#3 by Tanmoy

Hi Chris,
Thank you very much for your quick reply.

I checked carefully and I found out that the .venv I created earlier is associated with Python 3.13.
Now I deleted this .venv and created a new .venv associated with Python 3.12. Then executed 

pip install otree==5.10.4 psycopg2 sentry-sdk
python.exe -m pip install --upgrade pip
.venv\Scripts\Activate.ps1

and finally, 'Invalidate and Restart'ed the pycharm.

It worked - shows the package installed and no error or redlines!!
Thanks a lot.

Write a reply

Set forum username