I have a space in a parent directory name which I can’t change because it contains about 60 other websites.
The solution was to create a new parent folder with the space written as “%20” and place a symbolic link in there to my original project folder, as suggested here: Error: Module not found on paths with a space in them