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

    (Again) adding python external modules

    Cinema 4D SDK
    r20 python
    2
    5
    1.4k
    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.
    • P
      pim
      last edited by pim

      I am trying to add an external python module, but do not succeed.
      I can run 'python setup.py install', but then I get the message

      c:\temp\binpacking-1.3>python setup.py install
      Traceback (most recent call last):
        File "setup.py", line 1, in <module>
          from setuptools import setup
      ImportError: No module named setuptools
      

      I guess I have to install setuptools first. Or has cinema 4d done this already?
      And what about pip, is that already in cinema 4d python?

      So, could somebody please help me with a step by step instruction how to install external python modules.

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

        Hi Pim, while we do not offer support for 3rd party module, I did know that Pycharm also setup pip and setuptools, so it's possible.

        With that's said, are you sure you are actually in the correct directory and python actually refer to the Cinema4D python and not another python instance installed?
        For more information about 3rd party installation directory please take a look at Python FAQ.

        I can only point you to https://pythonhosted.org/an_example_pypi_project/setuptools.html

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • P
          pim
          last edited by

          Thanks, I will study the documentation you are pointing to.

          -Pim

          1 Reply Last reply Reply Quote 0
          • P
            pim
            last edited by

            Part of the question was, whether cinema 4d python already has setuptools, pip, etc.
            Perhaps it is just my settings?

            install the modules in
            C:\Program Files\MAXON\CINEMA 4D R20.038\resource\modules\python\libs\python27

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

              Sorry if I wasn't clear. Cinema 4D Python does not come with setuptools or pip installed you have to do it.
              My point was, PyCharm automatically do it as long as the defined Project Interpreter is c4dpy.

              Just a quick overview:
              In Pycharm go to File -> Setting (CTRL+ALT+S)
              0_1547561830977_01.jpg

              Then Project Interpreter
              0_1547561878079_02.jpg

              In the top, click on the bolt button and Add
              0_1547561922307_03.jpg

              Make sure to rename c4dpy.exe to python.exe (Pycharm do not support something not called python)
              Then define the interpreter as python.exe (our c4dpy.exe located in our Cinema 4D installation)
              0_1547562066248_04.jpg
              Click Ok, Select it in the dropDown list, it should load a bit (installation process for pip and setuptools) Then click apply and pip/setuptools is available. You can also search for any package available from pip which is compatible with our version of Cinema 4D by clicking on the Green addition sign.

              With regards o your question, yes python installation directory is C:\Program Files\MAXON\CINEMA 4D R20.038\resource\modules\python\libs\python27 but you should never modify these files. And we are not responsible for any issues related to any modification of these files.

              Cheers,
              Maxime.

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

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