2

I try to import my function Shemptoo from the file housoto.py:

from housoto import Shemptoo

ModuleNotFoundError: No module named 'housoto'

This two file are on the same directories, i am on spyder python 2.7 and window 10.

EDIT: Pranay, I tried on the console : C:\Users\Pat>export PYTHONPATH=//:$PYTHONPATH Result:Access Denied.

I tried to keep init.py file in the same directory and it doesn't work to. Also, if it can help you to find the problem, when i tried to just import the module Shemptoo in the file housoto with import, the problem is the same.

It's important for me to to that beacause my project contains thousands line..Thanks for your help.

3 Answers3

0

One way could be adding the location of modules implicitly to the pythonpath:

export PYTHONPATH=/<location of module files>/:$PYTHONPATH (to add python path for module)

Pranay
  • 498
  • 1
  • 4
  • 16
0

Try import housoto directly. It may be because from tells the interpreter to look inside a folder (module which has an __init__.py file).

hridayns
  • 697
  • 8
  • 16
0

I did not know you were using Windows. For windows, you might want to look at this question and answers: How to add to the pythonpath in windows 7?

Pranay
  • 498
  • 1
  • 4
  • 16