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

    Import NumPy?

    Cinema 4D SDK
    python 2024
    3
    4
    830
    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.
    • justinleducJ
      justinleduc
      last edited by justinleduc

      Hey guys,

      Context: I'm completely new to scripting in Cinema4D and I've just spent the last 30 minutes searching this forum for "numpy" and unfortunately it seems like I was never able to get a clear answer. Apologies in advance if you feel like the topic has already been covered extensively.

      Goal: I would like to import the NumPy module in C4D 2024.0.1 and use the full extent of its methods and functions. Is there a way of doing so? If not, does the fact that I won't be redistributing my script help, as in making it more of a possibility?... as in, a more "hack-ey" way to go about it.

      Thank you very much for your time and assistance! I really appreciate it 🙂

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @justinleduc with c4dpy this is pretty straightforward. Run it once to get a license assigned to it, then once it's licensed run the next commands:
        c4dpy -m ensurepip to install pip and then c4dpy -m pip install numpy.

        Then you can start Cinema 4D and you will be able to use numpy within Cinema 4D.
        Final note as said in Python Libraries Manual.

        MAXON cannot provide support for third party libraries written for CPython and their compatibility with the Python interpreters shipped with Cinema 4D. While our Python interpreters are derived from the respective CPython builds, they are not identical to them. Popular Python libraries as for example numpy might not work at all or only with a reduced feature set. The Cinema 4D Python interpreters are provided as-is and not meant to be fully CPython compliant.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        justinleducJ 1 Reply Last reply Reply Quote 1
        • justinleducJ
          justinleduc @m_adam
          last edited by

          @m_adam Ah! Wonderful! Thank you so very much Maxime! I really appreciate it.

          1 Reply Last reply Reply Quote 0
          • G
            Gregor M
            last edited by

            Hi, I'm also trying to install numpy, but after registering c4dpy I'm getting a syntax error after running "c4dpy -m ensurepip" command.

            c4dpy -m ensurepip
            (null) File "<stdin>", line 1
            c4dpy -m ensurepip
            ^^^^^^^^^
            (null)SyntaxError: invalid syntax

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