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
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How to compile Python c-modules

    PYTHON Development
    0
    5
    456
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 27/05/2016 at 01:01, xxxxxxxx wrote:

      Hey developers,

      I want to use pygame module in Cinema R17. I placed the modules in the ....\python\packages\win64 folder and I got this fancy error:

      I red about this topic in this post: https://developers.maxon.net/forum/topic/9037/11994_strange-behavior-of-py-27-in-r17

      My problem is, that I am a noob 😢 and don't know how to compile wheels with the right compiler. (In this case (VS 2012 sp4). I recompiled this wheel pygame-1.9.2a0-cp27-none-win_amd64.whl using pip and it works in my python IDLE.

      Maybe you know a link to a tutorial or can provide my other help 🙂

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 27/05/2016 at 03:34, xxxxxxxx wrote:

        Hi Matthäus,

        unfortunately we don't have much more information than provided in the thread you already linked to. And we neither have the resources nor are we capable of supporting 3rd party Python modules.
        But I'm counting on Niklas to jump into this thread. He's probably one of our most knowing community members with excellent Python skills.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 27/05/2016 at 04:04, xxxxxxxx wrote:

          Okay. So I will count on Niklas too 🙂

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 27/05/2016 at 08:28, xxxxxxxx wrote:

            Compiling Pygame from scratch is pretty complicated unfortunately. You need SDL, PNG, ZLib and more,
            all of which you can find here:

            http://pygame.org/wiki/MingW#pygame dependencies on windows

            To compile a Python C extension for Cinema 4D, you should use the Python interpreter that is embedded
            within the C4D installation directory. I found it best to just copy the whole Python.win64.framework
            folder to a completely new directory (one where the path contains no whitespaces!) and use the
            python.exe there to execute the setup scripts in the Python modules to build them.

            D:\Downloads\Python.win64.framework\python.exe setup.py build build_ext
            

            You will need Visual Studio 2010 installed on your system to compile Python C extensions on Windows.

            Hope that helps,
            -Niklas

            PS: The path to the embedded Python version is {C4D_INSTALL_DIR}/resource/modules/python/Python.win64.framework

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 27/05/2016 at 08:56, xxxxxxxx wrote:

              Great! Thank you Niklas. I will try my best. 🙂

              1 Reply Last reply Reply Quote 0
              • First post
                Last post