-1

I tried importing factor_analyzer in Jupyter notebook. But I got this error that says 'no module named utils' I recently switched from Python 3 to 2; never had this issue with Python 3. How do I fix this? - Samuel Duraivel enter image description here

greg-449
  • 106,591
  • 226
  • 99
  • 140
  • Why are you switching back to 2? And if this is a new Python installation, why are you expecting it to have the module in question? – Karl Knechtel Jul 07 '20 at 03:33
  • Checking the manual https://buildmedia.readthedocs.org/media/pdf/factor-analyzer/latest/factor-analyzer.pdf and github page https://github.com/EducationalTestingService/factor_analyzer, it says it requires python 3.4 and higher. Check if this might be helpful. Best Regards – smile Jul 07 '20 at 03:37
  • I was getting a 'kernel.dll' error with Python 3. I re-installed the .dll and changed the path environment, but the issue did not get fixed; so, I had to switch back to Python 2. And no, this is not a new Python installation. – SAMUEL DURAIVEL Jul 07 '20 at 03:40

4 Answers4

1

It seems the utils module is not installed on the system. Try installing it with pip :

python -m pip install utils
Roshin Raphel
  • 2,478
  • 3
  • 18
  • 34
0

i also faced same problem (import error)while trying to import different modules in python 3.7,so what i did is i just uninstalled the python 3.7 and installed new version of python which is 3.8 and i can able to import my modules without errors,so try using latest version....

0

The specific error happens when the Python interpreter can't find a particular ".py" file. In your case, it is the file "utils.py".

First you need to find which file is trying to import "utils.py". Starting with your main file, look up all the files you are importing. (I am guessing this issue is coming from one of the non-library files, but I could be wrong.)

Once you have the "top level" import list, check each of those files to see what THEY are importing, and repeat the process for them. Eventually, you will find the .py file which is trying to import "utils". There might be a directory specification forcing Python to look in the wrong place.

Finally, using windows' file manager, perform a search for "utils.py". As a temporary fix, you can copy it from its current location into your working directory. That will at least allow you to get your project up and running until you sort out the real cause.

Omar
  • 806
  • 11
  • 11
0

utils.py and utils folder could be utilities code written for specific purpose. So it is advised to copy it from the repo to the root of your project folder.

Lin
  • 11
  • 3