close

[Solved] ImportError: No module named

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ImportError: No module named <something> in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ImportError: No module named <something> Error Occurs?

Today I get the following error ImportError: No module named <something> in python.

How To Solve ImportError: No module named <something> Error ?

  1. How To Solve ImportError: No module named Error ?

    To Solve ImportError: No module named <something> Error To make import walk through your directories every directory must have a __init__.py file.

  2. ImportError: No module named

    To Solve ImportError: No module named <something> Error To make import walk through your directories every directory must have a __init__.py file.

Solution 1

Based on your comments to orip’s post, I guess this is what happened:

  1. You edited __init__.py on windows.
  2. The windows editor added something non-printing, perhaps a carriage-return (end-of-line in Windows is CR/LF; in unix it is LF only), or perhaps a CTRL-Z (windows end-of-file).
  3. You used WinSCP to copy the file to your unix box.
  4. WinSCP thought: “This has something that’s not basic text; I’ll put a .bin extension to indicate binary data.”
  5. The missing __init__.py (now called __init__.py.bin) means python doesn’t understand toolkit as a package.
  6. You create __init__.py in the appropriate directory and everything works… ?

Solution 2

Does

(local directory)/site-packages/toolkit

have a __init__.py?

To make import walk through your directories every directory must have a __init__.py file.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read