Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Hi all, I'm especially pleased to see that the snake-heads I respect most are getting to grips with wxPython UI issues on the Mac, in the absence of TkInter support under PPro2012. I frequently find, however, that python modules (defined by a folder/directory named for the module and containing an init.py file) are not found when they are located within the application's default Runtime:Python folder.
It seems very strange to me that the folder containing the module appears in the sys.path if I print it from the python shell, yet attempts by launch scripts which try to import the named module fail with "ImportError: No module named blah" errors. The vagaries of Python on the Mac seem to dictate that the folder containing the module named folder itself must be in sys.path or the module is deemed not to have been found. Indeed, if I execute sys.path.append('Applications/Poser Pro 2012/Runtime/Python'), a subsequent attempt to reference any module which resides in a folder within that directory will succeed.
This does seem logical, but I can only assume that it must work differently on windows as I don't see any complaints about the many free scripts that are distributed as modules.
I assume it would be possible to perform this sys.path.append within the launch script, but I wonder why it isn't being done as a matter of course. Again, I assume it's not required on windows systems.
My ShareCG Stuff
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.