#1 by Mouli
Hi, I am installing otree in my new laptop. It does not have any old version of otree. I am getting error with pip's dependence. The screenshot of the errors is attached here. Any help will be much appreciated. The solution might be already posted but I could not find it. If someone can direct me there, it would be great. Best wishes, Mouli Modak
#2 by Chris_oTree
It looks like oTree was successfully installed. However, it looks like you have many other Python packages installed. Are you using Python for some non-oTree projects? That code might not work properly anymore. You can resolve the issue with separate virtual environments ; you can read about virtualenvs online.
#3 by Mouli
Hi, No, otree has not been installed successfully. What should I do? Best wishes, Mouli
#4 by Mouli
Hi, Bumping this. I would really appreciate some help on this. Best wishes, Mouli
#5 by BonnEconLab (edited )
One thing that I have experienced to cause trouble with oTree under Windows is having installed Python with admin privileges. So, one solution might be to reinstall Python. On the very first screen (if installing Python 3.11.9), make sure that “Use admin privileges when installing py.exe” ist NOT selected. Also, if you choose “Customize installation,” do NOT choose “for all users.” And in “Advanced Options,” do NOT select “Install Python 3.11 for all users.”
#6 by BonnEconLab (edited )
If you do not want to reinstall Python entirely, create a virtual environment, as Chris_oTree already suggested. You seem to be using Conda. Hence, conda create -n oTree_env should work. See https://conda.io/projects/conda/en/latest/user-guide/getting-started.html. Then switch to that environment via conda activate oTree_env and install oTree in that environment via `pip install otree` (I guess, `conda install otree` does not work). If you do not wish to use Conda, you can create a virtual environment via Python itself, for instance, python -m venv C:\Users\mouli\oTree-env (However, I would create a subdirectory C:\Users\mouli\venv first, and then run `python -m venv C:\Users\mouli\venv\oTree-env`.) Afterwards, execute C:\Users\mouli\oTree-env\Scripts\activate.bat (or, C:\Users\mouli\oTree-env\Scripts\Activate.ps1, if you use PowerShell) to activate the virtual environment. See https://docs.python.org/3/library/venv.html. After activating the virtual environment, execute `pip install otree`.