(Again) adding python external modules



  • 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.



  • 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.



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

    -Pim



  • 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



  • 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.


Log in to reply