no mongoengine or version 3.2
in OpenSesame
Hello,
I was trying to execute a preexisting experiment on a new Windows PC, but when using the new version 3.3.9 the launch crashes when OpenSesame tries to install mongoengine (which turns into error while executing inline script).
The version which we know is compatible with the experiment is version 3.2. However, when I try to download it through the respective channel, I get the new version instead (3.3.9 again).
Can you help me please, either by pointing out the bugfix with the mongoengine (which it says is not installed, even in the megapack installer), or by indicating the 3.2 download path?
Many thanks in advance,
Jonas
Comments
here the same error message after trying several times:
Details
install_missing_modulesprepareSessionSettings[run].Experiment[prepare].install_missing_modules[prepare]Tue Aug 31 12:56:34 2021ModuleNotFoundErrorNo module named 'mongoengine'Traceback (also in debug window)
Inline script, line 37, in check_install File "C:\Program Files (x86)\OpenSesame\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "Hi @jonas ,
My guess is that
mongoenginefails to install (and therefore later fails to be imported), but that can happen for any number of reasons. Could you post the actual script and the full output from the console? There's probably another error in there related to the failed installation.— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Great, thanks a lot @sebastiaan !
I think this is the script you mean, called "install_missing_modules":
----
import sysimport importlib
check_modules = ['mongoengine','faker','selenium']
if sys.platform == 'win32':
check_modules += [('win32gui','pywin32')]
print("Checking for missing modules")
try:
import pip
pip_cmd = pip.main
except:
import pip._internal
pip_cmd = pip._internal.main
cnvs = Canvas()
cnvs.text("Installing required modules. Please wait...", y=-40)
modules = []
def update_status():
c = Canvas()
c.copy(cnvs)
offset = 0
for msg in modules:
c.text(msg, y=offset)
offset += 40
c.show()
def check_install(mod_name):
if type(mod_name) is tuple:
import_lib = mod_name[0]
lib_name = mod_name[1]
else:
import_lib = lib_name = mod_name
try:
return importlib.import_module(import_lib)
except ImportError:
modules.append("Installing {}".format(lib_name))
print('Could not import {}, attempting to install'.format(lib_name))
update_status()
pip_cmd(['install', lib_name])
modules[-1] = "Installed {}".format(lib_name)
return importlib.import_module(import_lib)
for module in check_modules:
lib_name = (type(module) is tuple and module[0]) or module
vars()[lib_name] = check_install(module)
And here again the error message (not sure what went wrong copy-pasting it earlier, sorry):
Details
install_missing_modulesprepareSessionSettings[run].Experiment[prepare].install_missing_modules[prepare]Fri Sep 3 17:04:06 2021ModuleNotFoundErrorNo module named 'mongoengine'Traceback (also in debug window)
Inline script, line 37, in check_install File "C:\Program Files (x86)\OpenSesame\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'mongoengine' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\inline_script.py", line 92, in prepare self.workspace._exec(self.cprepare) File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec exec(bytecode, self._globals) Inline script, line 48, in <module> Inline script, line 44, in check_install File "C:\Program Files (x86)\OpenSesame\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'mongoengine'Hi @jonas ,
Can you also post the output from the console? The error message (Traceback) only contains a description of the direct cause of the crash. However, I suspect that before this happens, at the point where the script tries to install the missing modules, there will also be output indicating what went wrong there. And this output should be in the console, before the error message that you've posted now.
-- Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
hi again @sebastiaan ,
sorry for the long delay. Now I finally managed to try again and locate the console output.
please let me know if this gives clearer hints.
cheers, jonas
Hi @jonas ,
I think it's a permissions issue: you need to run OpenSesame as administrator so that the package can be installed.
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!