| Reference | Downloads | Github

No module named 'lmfit'

I have a .py script that works perfectly in Jupyter Notebook.
However, when I run it with Psychopy at the line “from lmfit import Model” gives me the error “ModuleNotFoundError: No module named ‘lmfit’”

Do I need to install lmfit in Psychopy as well? How can I do that?



Are you using a standalone download of PsychoPy? If so, the Python being used by PsychoPy may be different from the one you’re calling when you use Jupyter Notebook. You need to download the lmfit package on the Python called by PsychoPy specifically.

Here are some handy instructions:

First, I copied and pasted the lmfit package in the package contents of Psychopy
I then went to Preferences-General and added the path:
[’/Users/myname/Applications/’, ]

I also added “import psychopy” at the beginning of my script, but same error.

What am I doing wrong?