# I cannot add Python mode!

**URL:** <https://discourse.processing.org/t/i-cannot-add-python-mode/40630>\
**Category:** Processing.py\
**Created:** [January 18, 2023, 11:03am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630 "2023-01-18T11:03:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alkis](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alkis](https://discourse.processing.org/u/Alkis)\
**Post date:** [January 18, 2023, 11:03am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/1 "2023-01-18T11:03:08Z")

</div>

Processing 4 has no “Add mode” option in the drop down menu as described by dozens of references in the Web! So I am stuck without being able to use Python scripts in Processing IDE!

Can anyone tell me how to install Python mode/libraries in Processing 4?

Thank you.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [January 18, 2023, 1:12pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/2 "2023-01-18T13:12:47Z")

</div>

Hi

Search the forum for More details

> [@Python Mode for Processing 4 alpha](https://discourse.processing.org/t/python-mode-for-processing-4-alpha/30760):
>
> For anybody who wants to help test this – Download this file: [https://github.com/tabreturn/processing.py-for-processing-4/raw/main/PythonMode-4.0a4.zip](https://github.com/tabreturn/processing.py-for-processing-4/raw/main/PythonMode-4.0a4.zip) Extract it and place the PythonMode directory in your sketchbook modes directory (see File \> Preferences menu in Processing for this location). Replace any existing PythonMode files. If you’re running Processing 3 and 4 on the same system, they both use the same sketchbook location (but this build seems to work fine in both). To report issue…

---

<div class="post-metadata">

**Author:** ![Alkis](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alkis](https://discourse.processing.org/u/Alkis)\
**Post date:** [January 18, 2023, 5:41pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/3 "2023-01-18T17:41:37Z")

</div>

1. There’s no “Sketchbook mode” directory. There’s only a Sketchbook folder and this is the default C:\Users{username}\AppData\Roaming\Processing folder in File-\>Preferences.
2. I cannot place the PythonMode directory that I just downloaded in the Sketchbook folder as you said, because Processing 4 refuses to change Sketchbook folder to the one I instructed it to in ‘preferences.txt’, as I mentioned in my first launched topic.
3. However, **there is** a “modes” directory under the main Processing directory (\Processing\modes) containing only Java, which also appears as the only installed mode in the menu at the right of the tools bar. So, I placed the PythonMode directory also in there. Logically, this should work, right? Well, guess what. It doesn’t! I can’t see Python either in the modes drop-down list or in “Manage modes” appearing in the same list. (BTW, there’s no “Add mode” options as **all** the references that I read mention.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 18, 2023, 6:00pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/4 "2023-01-18T18:00:23Z")

</div>

Did you install the Python mode? Here’s what I see on my system when I click on the mode box in the upper right hand corner of the editor:  
 ![modes](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/5/a/5a8274dc99293e58777f53bb02dc7fc56e02e571.png)

I just now noticed that the Modes tab is empty on my system too. No wonder you can’t install it! Perhaps it got lost on the last update. I’m using version 4.1.1.

 ![cm](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/a/6adf3605521ccd9e2fe1f46ebc2b4c45e4255153.png)

**Addendum:**  
I just switched to a Windows 11 system and was able to install the Python mode (now shows up in menu) using the technique described in @jafal 's post. I extracted the .zip file (in Downloads folder) into c:\Users\myName\Documents\Processing\modes and it worked.

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 18, 2023, 7:04pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/5 "2023-01-18T19:04:28Z")

</div>

Try extracting the pythonMode .zip file into the Processing/modes folder instead of directly placing it in there.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [January 18, 2023, 11:47pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/6 "2023-01-18T23:47:12Z")

</div>

Hello,

Issue and solution discussed here:

> <https://github.com/processing/processing4/issues/613>
>
> \## Description
> In Processing 4.1.1 it is currently seemingly impossible to down…load and switch between modes.
> 
> \## Expected Behavior
> In Processing 3.5.4 if you open the "Modes" tab in the "Contribution Manager" window, there is a list of modes you can potentially install. At the very least you should find "R Mode" and "Python Mode". You can download any of these (the ones that are supported anyways) and than can use them in Processing.
> 
> \## Current Behavior
> In Processing 4.1.1 (and 4.1 and possibly earlier versions I haven't tested) when you click "Manage Modes..." you are taken to an empty "Modes" tab in the "Contribution Manager" window. There are no modes ready to download, therefore you are stuck in Java mode.
> 
> \## Steps to Reproduce
> 1. Run Processing 4.1.\*
> 2. Click on the selector with the word "Java" and a little downward triangle in it
> 3. Click on "Manage Modes..."
> 
> \## Your Environment
> \* Processing version: 4.1.1
> \* Operating System and OS version: Windows 11 Pro x64 22H2 Build: 22621.900
> 
> \## Possible Causes / Solutions
> Not sure about the cause but I found a workaround (though haven't tested fully).
> I downloaded Processing 3.5.4 and installed Python mode on it.
> I than opened Processing 4.1.1 and I found that it also had Python mode installed.
> The Modes tab was still empty, but apparently the mode for 3.5.4 was saved in the same place 4.1.1 was looking, and it at least thinks it can be used. I'm not sure how well it works.
> 
> Image:
> !\[image\](https://user-images.githubusercontent.com/6439157/204891586-96bee15a-c6b1-41ae-a295-c66902c92a62.png)

Processing 4.1.2 is now available:

> **[Download](https://processing.org/download/)**
>
> Processing is available for Linux, Mac, and Windows. Select your choice to download the software below.

`:)`

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [January 19, 2023, 12:29am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/7 "2023-01-19T00:29:12Z")

</div>

That’s pretty tricky; have to open libraries tab first then switch to modes tab.

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [January 19, 2023, 6:02am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/8 "2023-01-19T06:02:36Z")

</div>

I strongly recommend Processing 3.5.4 for Python Mode. There are some compatibility issues to resolve with Processing 4.x

---

<div class="post-metadata">

**Author:** ![Alkis](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alkis](https://discourse.processing.org/u/Alkis)\
**Post date:** [January 19, 2023, 8:41am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/9 "2023-01-19T08:41:15Z")

</div>

Re _“Did you install the Python mode?”_:  
But this is exactly I’m trying to figure out. How to add/install Python mode.

Re _“I extracted the .zip file (in Downloads folder) into c:\Users\myName\Documents\Processing\modes and it worked.”_:  
I would try that too, but I don’t want to use drive C: (which is the default one) for such a task. I tried to change the Sketchbook folder to another drive --with the instructions @jafal gave me-- but Processing 4 refuses to do that or ignores it.  
I placed instead under "\Processing\modes’ where Java is also placed. But Processing 4 ignores that too.

---

<div class="post-metadata">

**Author:** ![Alkis](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alkis](https://discourse.processing.org/u/Alkis)\
**Post date:** [January 19, 2023, 9:36am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/10 "2023-01-19T09:36:34Z")

</div>

In another thread, which refers to this issue as a bug, someone suggested to download version 4.1.2.  
Well, I downloaded version 4.1.1 only yesterday! And it was in the “Stable” versions list!  
Do they release versions everyday?  
Or was I just extremely unlucky? 🙃

---

<div class="post-metadata">

**Author:** ![Alkis](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alkis](https://discourse.processing.org/u/Alkis)\
**Post date:** [January 19, 2023, 10:16am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/11 "2023-01-19T10:16:08Z")

</div>

@tabreturn you are a life saver! Thanks a mil!  
Both my issues solved immediately and in a way that is expected with version 3.5.4!

1. Sketchbook folder can be changed on the spot
2. Python mode can be installed on the spot, using “Add mode” in the above changed folder

What a case! Downgrading to an earlier **main** version solving problems!

Thanks a lot to everyone who contributed! 🙏

---

<div class="post-metadata">

**Author:** ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)\
**Post date:** [January 20, 2023, 12:34pm UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/12 "2023-01-20T12:34:32Z")

</div>

Processing version 4.1.2 was released on Tuesday. You can now find it on the [Download page](https://processing.org/download).

---

<div class="post-metadata">

**Author:** ![gulshan212](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gulshan212/32/17860_2.png) [@gulshan212](https://discourse.processing.org/u/gulshan212)\
**Post date:** [January 25, 2023, 5:50am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630/13 "2023-01-25T05:50:25Z")

</div>

Hello this is Gulshan Negi  
Well, to install Python mode/libraries in Processing 4, you will need to follow these steps:

1. Download and install the latest version of Processing 4 from the Processing website.
2. Open Processing 4 and go to the “Sketch” menu, then select “Import Library” and then “Add Library”.
3. In the “Contribution Manager” window, you will find a list of available libraries.
4. Type “Python” in the search bar, and it will show you the available Python libraries for Processing 4.
5. Select the library you want to install and click on the “Install” button.
6. The library will be downloaded and installed. After installation, you’ll be able to use the library in your sketches.  
Thanks
