As I was trying to find out a solution on how to do this in this forum, I came across this reply on how to install pip in Cinema 4D:
Now how to install pip? 1. Downloads https://bootstrap.pypa.io/get-pip.py. 2. Downloads the c4dpy version matching your Cinema 4D version. (Already included in R21) 3. Moves c4dpy and get-pip.py in the Cinema 4D folder. 4. Opens a shell to the Cinema 4D folder: Window: Type cmd in the top path and press Enter. Mac: Open a new shell, then with cd navigate to your Cinema 4D folder. (You can drag and drop the path). 5. Runs this command line c4dpy get-pip.py. This will execute the get-pip script which will, download and install the pip module. 6. Now you can start to play with pip c4dpy -m pip install numpy. c4dpy allow to runs any module with the -m argument see c4dpy commandline. in this case I asked to pip to download and install numpy but any other 3rd party compatible with pip can be downloaded and used. With that's said we do not provide support for 3rd party modules, so if it does not work with Cinema 4D Python environment, we can't help you. Cheers, Maxime.
I got some questions:
- for step 1, when I opened the link, it redirects me to a wall of code. Do I copy + paste it in Python's IDLE and make a .py out of it? how do I install it exactly
- for step 2, I am confused which one I should download here
- for step 3, by "Cinema 4D folder" which one do you mean? like the exact path?
- for step 4, I do something like this right?
(I select "Open PowerShell window here" then run the code from step 5, right?)
I want to use pip to make this line of code work inside Cinema 4D:
from pynput.keyboard import Key, Controller import time keyboard = Controller() time.sleep(2) keyboard.press('4') keyboard.release('4')
Will this code work when I successfully follow the "how to install pip" instruction?
Thank you guys