oTree and settings module not found 关注
Hi, I have been using pycharm to run a series of oTree experiments - and the last time I had used it with in 2021. I have started coding a new set of experiments, and when I try to run my init.py files through the python console, I get the following error (see below). I am not quite sure why it is that the settings module isn't being found and I have never had this problem before and I am not sure how to go about fixing it. Any advice would be deeply appreciated.
Thanks!
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\settings.py", line 30, in <module>
import settings
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'settings'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\pydevconsole.py", line 390, in do_exit
import java.lang.System
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'java'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\api.py", line 1, in <module>
from otree.models import BaseSubsession, BaseGroup, BasePlayer # noqa
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\models\__init__.py", line 1, in <module>
from otree.models.subsession import BaseSubsession
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\models\subsession.py", line 12, in <module>
import otree.common
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\common.py", line 18, in <module>
from otree import settings
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\otree\settings.py", line 39, in <module>
sys.exit(msg)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev\pydevconsole.py", line 395, in do_exit
os._exit(args[0])
TypeError: an integer is required (got type str)
请先登录再写评论。
Hi,
Could you please check if the same code runs well from the system terminal?