[Eric] No module named
Leonardo Giordani
giordani.leonardo at gmail.com
Fri Oct 14 14:43:47 BST 2011
Here on Linux the same configuration works perfectly.
I built the same files as in your picture, with
$ cat MyProject/main.py
from MyProject.package1.Settings import Settings
$ cat MyProject/package1/Settings.py
class
Settings:
pass
So I suspect something wrong with the content of the files, perhaps some
cyclic imports?
I would advice not to add in project files imports with the full project
path, i.e. in main.py just state
from package1.Settings import Settings
instead of
from MyProject.package1.Settings import Settings
Anyway this is not the problem now.
You could post the content of your main.py, at least the first 20 lines.
Best regards
Leo
2011/10/12 <admin at mbnoimi.net>
> Hi All,
>
> I've created a project by Eric its structure as following:
>
> http://i.stack.imgur.com/fgpFa.jpg
>
> I can run it successfully in the IDE by specifying (
> http://i.stack.imgur.com/vskbO.jpg):
>
> - "c:\trunk" as working directory
> - "MyProject\main.py" as main script
>
> but it I can't run it by command line because I get:
>
> ImportError: No module named package1.Settings
>
>
>
> PS
>
> I added "c:\trunk\Project" to system path (see run.bat please):
>
> set PATH=%PATH%;%CD%
> python MyProject\main.py
> pause
>
>
>
> here is the running log:
>
> C:\trunk>set PATH=C:\Python26\Lib\site-packages\PyQt4\bin;C:\Python26\Scripts;C:\Python26;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Bazaar;C:\ProgramFiles\doxygen\bin;C:\Program Files\WinMerge;C:\trunk
>
> C:\trunk>python MyProject\main.py
> Traceback (most recent call last):
> File "MyProject\main.py", line 17, in <module>
> from MyProject.package1.Settings import Settings
> File "C:\trunk\MyProject\main.py", line 17, in
> <module>
> from MyProject.package1.Settings import Settings
> ImportError: No module named package1.Settings
>
>
> --
> Best Regards
> Muhammad Bashir Al-Noimi
> My Blog: http://mbnoimi.net
>
>
> _______________________________________________
> Eric mailing list
> Eric at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/eric
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20111014/cad1a984/attachment.html>
More information about the Eric
mailing list