Listing installed Python Modules

  • I'm having trouble with ShaderWorks' Postwork Manager saving a JPEG image and keep getting a "encoder JPEG not available". Web searches imply that this may be a problem with the Python installation, yet this is bundled with Poser and is not the MacOS' own Python installation. As part of troubleshooting Poser's own Python bundle, I've tried to list the installed modules from the Poser Python shell, using help() and then the "modules" keyword. Unfortunately this crashes Poser. I know this worked in the past, yet I have to go back to the earliest Poser I have installed Poser Pro 2010 (version 8) which bundles Python 2.4 to find a version where "modules" will give me a list of all packages and modules installed with that Python bundle. Poser Pro 2012 (version 9), Poser Pro 2014 (version 10) and Poser Pro 11 (version 11) all have various versions of Python 2.7 and every one of them crashes Poser when I try to list the installed python modules.

    Can anyone else on MacOS confirm whether they see this before I attempt to reinstall Poser and/or report this to SMS?

  • To clarify, I'm trying to find out whether there is actually a missing component of the PIL package in MacOS Poser's version of Python 2.7. Are there any other MacOS users out there who have successfully saved a jpg render with ShaderWorks' Postwork Manager?

  • Urk. Don't think this is what I'm supposed to get:

    help> modules PIL

    Here is a list of matching modules. Enter any module name to get more help.

    Traceback (most recent call last):
    File "<input>", line 1, in <module>
    File "/Applications/Poser 11/", line 467, in call
    return*args, **kwds)
    File "/Applications/Poser 11/", line 1730, in call
    File "/Applications/Poser 11/", line 1748, in interact
    File "/Applications/Poser 11/", line 1768, in help
    File "/Applications/Poser 11/", line 1873, in listmodules
    File "/Applications/Poser 11/", line 1973, in apropos
    ModuleScanner().run(callback, key)
    File "/Applications/Poser 11/", line 1938, in run
    for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
    File "/Applications/Poser 11/", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
    File "/Applications/Poser 11/", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
    File "/Applications/Poser 11/", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
    File "/Applications/Poser 11/", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
    File "/Applications/Poser 11/", line 110, in walk_packages
    File "/Applications/Poser 11/", line 16, in <module>
    raise RuntimeError(msg)
    RuntimeError: Should not import this directly, used by pubsub.core if applicable

  • I can confirm the "encoder JPEG not available" error on OS X 10.11.6

  • Thanks @nagra_00_ .
    I have now submitted a bug report to SMS.

  • @nagra_00_ (and other MacOS users) could you check whether your Poser Python Shell allows you to list the installed modules and let me know your Poser version and the version of Python the shell reports? Beware that this will quite likely crash Poser, so please don't try it in a scene you haven't saved.

    From the Poser > Windows > Addons menu select Python Shell. Note the Python version. Mine shows:

    Welcome to the Poser Python shell.
    Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.

    At the >>> command prompt, enter 'help()' (without the quotes) and press return
    At the help> prompt, enter 'modules' (again without the quotes) and press return.

    Normally this would give you a list of all the python packages and modules installed. On MacOS 10.12.6 Poser Pro 2010 lists the modules, but Poser Pro 2012, Poser Pro 2014 and Poser Pro 11 all crash.

    I'm trying to discover whether I have a problem with my MacOS installation or whether it's Poser Python 2.7.x that's faulty.

  • OK, finally getting somewhere now. Yay!

    Following on from what I had to do back in 2012, to make use of the ScyPy python module which wasn't included in the Python bundled with Poser, I have successfully persuaded Poser to use a more recent, external installation of Pillow, a supported fork of the now moribund PIL (Python Imaging Libraries) package.

    Having installed Pillow-4.2.1 via the terminal command 'pip install Pillow' and verified its presence as a package from the MacOS Python IDLE shell, I shutdown Poser and navigated to the location its Python extensions are installed, namely: /Applications/Poser 11/

    Once there, I renamed the 'PIL' folder to 'oldPIL' and duplicated the PIL.pth file to oldPIL.pth (can easily be done from a Finder window)

    From the terminal window (and this needs to be done here, not in the Finder), I created a soft-link from the newly installed Pillow to Poser's site-packages with the command:
    ln -s /usr/local/lib/python2.7/site-packages/PIL
    This needs to be a soft link, rather than a finder alias, as python and shell scripts generally don't know how to traverse Finder aliases, but do work with soft links.

    The final step to replace PIL was to insert the path /usr/local/lib/python2.7/site-packages/PIL into the existing PIL.pth file (which previously contained just 'PIL', pointing to the local Poser bundled PIL folder).

    With that out of the way, I could re-launch Poser and finally get back to troubleshooting the Shaderworks' Postwork Manager script. Unfortunately, it didn't just work, but threw up an error relating to a deprecated method tostring() which has been replaced with a method tobytes() in the latest Pillow (PIL) release. However, simply replacing every occurrence of tostring with tobytes (there were only 3 within the first 25 lines of the script) in '/Applications/Poser 11/Runtime/Python/poserScripts/ScriptsMenu/Partners/ShaderWorks/Postwork' (after making a backup copy) restores Postwork Manager's ability to save JPEG images on MacOS.

    0_1501233942745_Ashi Iridescent Swimsuit'.jpg


  • @anomalaus said in Listing installed Python Modules:

    ln -s /usr/local/lib/python2.7/site-packages/PIL

    Just updated to Poser Pro and had to go through the same process of replacing the bundled PIL to get it to save JPG images from ShaderWorks Postwork Manager (patched) script. Not that I expected anything to have been fixed so quickly ;-), but happy that I got to confirm that the process (rename PIL & soft-link external PIL) still did the job.