0

I was trying to import "progress_bar" function from mutils1.py

from mutils1 import progress_bar

the error happens:

 Traceback (most 
    recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: cannot import name 'progress_bar' from 'mutils1' (/username/DeepFacade-master/mutils1.py)
Python Lover
  • 51
  • 10
  • Why are you pretending your code is HTML/JS, when it is not? Stackoverflow does support syntax highlighting for python. – Sören May 02 '22 at 19:41
  • The code of mutils.py is basically irrelevant. What's more important is how you import it. – Sören May 02 '22 at 19:44
  • @Sören sorry, I pasted the code in the wrong place! I am gonna import "progress_bar" function which is within mutils1.py – Python Lover May 02 '22 at 19:49
  • What is your current working directory when you do the import? – Sören May 02 '22 at 21:46
  • I think the error means it found the mutil1.py file, but can't find anything called progress_bar. Check you've saved the file. Also try renaming mutil1.py. You'll get a different error message if that's the mutil1.py file being used. – pcoates May 02 '22 at 22:25
  • @Sören the current directory is : ~/scratch/amirabb/DeepFacDe-master/mutils.py – Python Lover May 02 '22 at 23:52
  • @pcoates thanks for your response! I just renamed mutils1.py and it works! – Python Lover May 03 '22 at 00:16
  • 1
    Does this answer your question? [How can I import other Python files?](https://stackoverflow.com/questions/2349991/how-can-i-import-other-python-files) – Vasyl Vaskivskyi May 03 '22 at 00:38

0 Answers0