| Reference | Downloads | Github

ImportError when module git cannot be loaded

Hi All!

Recently, we’ve run into a problem after updating PsychoPy.

Our setup: we use PsychoPy in a Miniconda installation but have remapped the “psychopy” folder in said installation onto an external folder which is frequently updated with the latest GitHub master of psychopy. This means that our Miniconda Python installation may lag behind the PsychoPy version pulled from GitHub.

Today, we updated to the current GitHub master of PsychoPy and were first required to install the “lazy_import” module. After doing so and executing a script invoking PsychoPy, Python goes into an infinite loop with the following error:

Error in callback <bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x000002143C29AF28>> (for post_execute):

Traceback (most recent call last):

  File "C:\Users\Malte\Miniconda3\envs\psypy3\lib\site-packages\IPython\extensions\", line 512, in post_execute_hook
    _, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])

  File "C:\Users\Malte\Miniconda3\envs\psypy3\lib\site-packages\IPython\extensions\", line 184, in filename_and_mtime
    if not hasattr(module, '__file__') or module.__file__ is None:

  File "C:\Users\Malte\Miniconda3\envs\psypy3\lib\site-packages\lazy_import\", line 156, in __getattribute__

  File "C:\Users\Malte\Miniconda3\envs\psypy3\lib\site-packages\lazy_import\", line 537, in _load_module
    msg.format(**modclass._lazy_import_error_strings)), None)

  File "<string>", line 3, in raise_from

ImportError: psychopy attempted to use a functionality that requires module git, but it couldn't be loaded. Please install git and retry.

The git module has been installed via the conda prompt. Is this a known problem?

Best, Malte

Quick update: a complete update of all conda and pip packages solved the issue.