Same error, No module named ? On Sunday, October 25, 2015 at 2:46:03 PM UTC-4, Justin Israel wrote: > > > On Mon, 26 Oct 2015 4:30 AM Christopher. <[email protected] > <javascript:>> wrote: > > I followed the instructions you posted and I got an error; > > #Error: ImportError: No module name SuperScript.MySuperScript.py # > > > > > Get rid of the .py part of that import command. You only use the names of > the files without extensions. > > import SuperScript.MySuperScript > > Yes there is a directory or package called SuperScript, and yes there is a > file called MySuperScript.py located in the directory / package. > > On Sunday, October 25, 2015 at 3:16:52 AM UTC-4, Justin Israel wrote: > > > On Sun, 25 Oct 2015 4:15 PM Crest Christopher <[email protected]> > wrote: > > The script calls to be executed as such; Superscript.ui() ? > > No. "Superscript" is the name of the package (directory). Then you have > some module which is the name of your file. So if you file is called > myFile.py, then you do > > import Superscript.myFile > Superscript.myFile.ui() > > > AK Eric wrote: > > > tl;dnr this whole thread. But you'd need to: > > import SuperScript.myModule > > SuperScript.myModule.myFunc() > > That's executing the myFunc function in the my myModule.py module living > under /SuperScript dir. > > x:/../../pythonscripts/SuperScript/myModule.py > > Generally, I don't often put any code in the __init__.py (I do > occasionally for very specific reasons). In general they're just there to > get your package paths setup right, so you can import everything correctly > without any fuss. > > -- > > You received this message because you are subscribed to a topic in the > Google Groups "Python Programming for Autodesk Maya" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/python_inside_maya/8SgJdsUZ0b8/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > [email protected] <javascript:>. > > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/c0949574-6c1c-43a8-9429-263e5b5b1649%40googlegroups.com > > <https://groups.google.com/d/msgid/python_inside_maya/c0949574-6c1c-43a8-9429-263e5b5b1649%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/562C495E.8050405%40gmail.com > > <https://groups.google.com/d/msgid/python_inside_maya/562C495E.8050405%40gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/805c2316-459c-43cd-a600-63073011d205%40googlegroups.com > > <https://groups.google.com/d/msgid/python_inside_maya/805c2316-459c-43cd-a600-63073011d205%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > >
-- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/37084f03-46e9-456a-b886-26831fef8c41%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
