python - import statement fails for one module -


OK I found out the problem on sys, it was an environmental issue, I had the same module (loan options .py). Path and she was importing from there. Thanks everyone for your help.

I have a series of import statements, which will not work in the past. Any ideas why? Options.py is all sitting in the same directory. Snipplets.highlight import from snipplets snipplets.db from snipplets import snipplets.createnew from dbSnipplet to snipplets.main import from MainHandler importNewHandler. Option Import Options

ImportError :. In the snipplets directory, my __init__.py file is empty

I think that one of your other imports, with a work statement defined in the new snipplets Or one of your other modules changed to sys.path .


Edit

"The flow is as follows: paths add packages to import ..."

No. Do not modify sys.path - In this way the problems are fixed Modifying about site.path is what leads to ambiguity - Or not - on the way, and in what order they are

simple, most reliable, most obvious. To do the most regulated work, really choose one.

  • Define PYTHONPATH (once, external to your program). A single, simple environmental variable that is almost identical on site-packages.

  • Install your packages in the site-package.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -