You’ve got an __init__.py
in your top level directory. That makes it a package. If you remove it, your nosetests
should work.
If you don’t remove it, you’ll have to change your import
to import dir.foo
, where dir
is the name of your directory.
More Related Contents:
- How to do relative imports in Python?
- How to import a module given its name as string?
- How to import the class within the same directory or sub directory?
- Import a file from a subdirectory?
- Automatically create requirements.txt
- How to check if a Python module exists without importing it
- Importing files from different folder
- adding directory to sys.path /PYTHONPATH
- PYTHONPATH vs. sys.path
- Absolute vs. explicit relative import of Python module
- In Python, what happens when you import inside of a function? [duplicate]
- Is `import module` better coding style than `from module import function`?
- Why use sys.path.append(path) instead of sys.path.insert(1, path)?
- Importing packages in Python
- How to unimport a python module which is already imported?
- Why can’t Python import Image from PIL?
- Should I use `import os.path` or `import os`?
- Why python mock patch doesn’t work?
- Python: reload component Y imported with ‘from X import Y’?
- When to use os.name, sys.platform, or platform.system?
- Python import modules from a higher level package
- Good or bad practice in Python: import in the middle of a file [duplicate]
- How to fix “no module named ‘app_one'”
- import error: ‘No module named’ *does* exist
- How can I import a module dynamically given the full path?
- Installing lxml module in python
- Python import error: cannot import name ‘six’ from ‘sklearn.externals’
- Importing module from string variable using “__import__” gives different results than a normal import statement
- Recursive version of ‘reload’
- How to add a Python import path using a .pth file