2

I have following directory structure,

/
  __init__.py
  __meta__.py

I tried to import __meta__ in a file but python complains about not finding a module named __meta__. I checked the current working directory for the file useing os.getcwd() which printed the directory with __meta__.py.

But I can import the module from python interpreter.

Asur
  • 1,949
  • 4
  • 23
  • 41

1 Answers1

4

Append it to sys path first, and then try to import your module

import os
import sys
sys.path.append(os.getcwd())
rafaelc
  • 57,686
  • 15
  • 58
  • 82