Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. rodrigo
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    rodrigo

    @rodrigo

    0
    Reputation
    3
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    rodrigo Unfollow Follow

    Latest posts made by rodrigo

    • RE: PYTHONPATH not appended to sys.path in Cinema 4D 24

      Ok, I didn't know we could/should set this environment variable in C4D 24.
      Thanks Ferdinand for your help!
      Cheers,
      Rodrigo

      posted in Cinema 4D SDK
      R
      rodrigo
    • PYTHONPATH not appended to sys.path in Cinema 4D 24

      Hello,

      We've been using Cinema 4D R20 and R21 for some years and now we're preparing to migrate to the S24.

      During these years, we've developed some Python Packages that are imported by our Python plugins.

      In C4D 20 and 21 these modules have always been imported by the plugin with no errors.

      In C4D 24, however, the same operation raises a "ModuleNotFoundError: No module named ..."

      The paths to our packages are appended to PYTHONPATH environment variable before launching C4D.

      Once C4D is launched, I've checked the PYTHONPATH in the Extension > Console > Python and the packages' paths are all there.

      The sys.path however doesn't contain the Packages Path, as if the $PYTHONPATH were not inserted into the sys.path upon launching C4D.

      Do you know if this is a known issue and if there's a "workaround" for importing external python packages in our C4D plugins (any workaround besides looping through the PYTHONPATH paths and appending them to the sys.path)?

      These tests were executed from Cinema S24.111 on Windows 10 Enterprise.

      Thanks for your help,
      Rodrigo
      Ps.: This issue seems to be related to the issue described in https://developers.maxon.net/forum/topic/11143/content-of-pythonpath-not-appended-to-sys-path. However, as the latter is focused on other versions of C4D and as it was marked as "solved", I've preferred to create a new topic.

      posted in Cinema 4D SDK s24 python
      R
      rodrigo