ImportError: No module named - Python

后端 未结 6 1650
闹比i
闹比i 2020-11-28 04:52

I have a python application with the following directory structure:

src
 |
 +---- main
 |
 +---- util
 |
 +---- gen_py
         |
         +---- lib
<         


        
6条回答
  •  天命终不由人
    2020-11-28 05:15

    This is if you are building a package and you are finding error in imports. I learnt it the hard way.The answer isn't to add the package to python path or to do it programatically (what if your module gets installed and your command adds it again?) thats a bad way.

    The right thing to do is: 1) Use virtualenv pyvenv-3.4 or something similar 2) Activate the development mode - $python setup.py develop

提交回复
热议问题