# Version of Python used in Python Mode

**URL:** https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254
**Category:** Processing.py
**Created:** [April 14, 2019, 8:28am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254 "2019-04-14T08:28:28Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)
#### Post date: [April 14, 2019, 8:28am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/1 "2019-04-14T08:28:28Z")

</div>

Hello wonderful discussion board!

Having a hellish time trying to install external modules and then importing in Processing Python mode. Running up against “ImportError: No Module named twitter found”.

My system python is 2.7.10

I have definitely installed, via pip, python wikipedia and python twitter (the aim is to suck up and use data).

Could processing be using a different version of python? Ie. I’m installing the above packages to a different python? I’m really at a loss at this stage.

Any help much appreciated.

---

<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: [April 14, 2019, 9:18am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/2 "2019-04-14T09:18:51Z")

</div>

You could add the modules to your sketch folder manually. Perhaps this is not your ideal solution, but it can be handy to have the files bundled with your sketch (i.e. like when you’re trying to run it on a different computer).

Here’s an example you can work off:  
[https://github.com/tabreturn/processing.py-in-ten-lessons/raw/master/twitter\_wikipedia\_sketch.zip](https://github.com/tabreturn/processing.py-in-ten-lessons/raw/master/twitter_wikipedia_sketch.zip)

---

<div class="post-metadata">

### Author: ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)
#### Post date: [April 14, 2019, 10:53am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/3 "2019-04-14T10:53:20Z")

</div>

Thanks for that! I didn’t know the modules could be loaded directly from the sketch folder. Certainly handy as this will ultimately run on another machine. Curiousnessnessness.

Are all those folders excepting /twitter/ and /wikipedia/ required?

---

<div class="post-metadata">

### Author: ![Afflospark](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Afflospark](https://discourse.processing.org/u/Afflospark)
#### Post date: [April 14, 2019, 6:29pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/4 "2019-04-14T18:29:00Z")

</div>

You have to include the python module in the project.  
This error might be due to some other reasons also, so better to uninstall python module and reinstall it.  
first, uninstall run these two commands  
“pip uninstall twitter” & “pip uninstall python-twitter”

now reinstall “pip3 install twitter”

Now create a new project and include the dependencies manually as tabreturn told in the last comment.

---

<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: [April 14, 2019, 8:08pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/5 "2019-04-14T20:08:49Z")

</div>

Yes – all of those other folders are required. Python twitter/wikipedia have various _dependencies_. For example, if you remove the _urllib3_ folder, then run your sketch, you will receive an error message stating that urllib3 is missing.

A tool like _pip_ automatically checks for- and downloads any required packages. However, you will find that some packages have no dependencies.

---

<div class="post-metadata">

### Author: ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)
#### Post date: [April 15, 2019, 7:43pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/6 "2019-04-15T19:43:27Z")

</div>

@tabreturn Brilliant - thanks for clarifying that. I might see if I can’t put them all in their own dir. The mess of all those folders makes me creak!

@Afflospark done and done 🙂

---

<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: [April 15, 2019, 8:21pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/7 "2019-04-15T20:21:40Z")

</div>

Yeah, it is kinda gross having all those directories laying about in the root!

To place them all within a sub-directory, you’ll have to change-up the import line and add an empty _\_\_init\_\_.py_ file. For example, say that you named this sub-directory _lib_:

```auto
- sketch
  - lib
     __init__.py
     + twitter
     + wikipedia
     + ...
  sketch.properties
  sketch.pyde

```

Then in your sketch file, import modules like this:

```auto
import lib.wikipedia as wp
print (wp.summary("Wikipedia"))

```

Of course, you can use whatever name you like for the `as` part of the statement.

---

<div class="post-metadata">

### Author: ![lnp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lnp/32/4911_2.png) [@lnp](https://discourse.processing.org/u/lnp)
#### Post date: [April 16, 2019, 5:51am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/8 "2019-04-16T05:51:02Z")

</div>

Too kind. I’ve only been on this discussion board for a short amount of time but I have to say I’m blown away at the expertise and generosity shown. Thank you.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [April 19, 2019, 4:11pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/9 "2019-04-19T16:11:58Z")

</div>

> [@Afflospark](#):
>
> now reinstall “pip3 install twitter”

If you are using [Python mode](https://py.processing.org/), it uses Python 2.7.3 running on Jython 2.7.1. `pip3` installs would not work – that installs Python 3 modules, and the mode cannot run Python 3 code (or anything CPython, for that matter) – only pure Python2.

---

<div class="post-metadata">

### Author: ![spambot9000](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/spambot9000/32/12568_2.png) [@spambot9000](https://discourse.processing.org/u/spambot9000)
#### Post date: [June 27, 2025, 11:07am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/10 "2025-06-27T11:07:13Z")

</div>

> [@jeremydouglass](#):
>
> If you are using [Python mode](https://py.processing.org/), it uses Python 2.7.3

In general, how does one determine the Python version besides asking on a forum? It would be handy to have this documented somewhere.

---

<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: [June 27, 2025, 1:17pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/11 "2025-06-27T13:17:14Z")

</div>

Hello,

This is the **Python Mode** that comes with the **Processing IDE** :

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/8/78c8964592540ae7dd5b5e659cd9c3eb17c71b7d.png)

The links (light blue text) bring you to this and will have more details:

> **[GitHub - jdf/processing.py: Write Processing sketches in Python](https://github.com/jdf/processing.py)**
>
> Write Processing sketches in Python

Note that it very clearly states:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/f/4ff5b0b6c900d6c9898c2628e6607ab3993503fe.png)

There are **3 Python categories** for each of the _ **Python projects** _:

- **Processing.py**
- **py5**
- **p5py**

The **py5** category is the one I have been using:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/f/d/fd4152591a95cfb86d5b6438b832393c219c88d1.png)

Topic in the **py5** category:

> [@New py5 release 0.10.3a1!](https://discourse.processing.org/t/new-py5-release-0-10-3a1/45316):
>
> py5 version 0.10.3a1 is now available! The big addition is a new Live Coding feature, enabling you to change the code of a running Sketch without needing to exit and restart. This works for py5 code in a Jupyter Notebook or code written in your editor such as VSCode. You can learn more about this here: [https://py5coding.org/content/live\_coding.html](https://py5coding.org/content/live_coding.html) Feedback on Live Coding is welcome!

This is in the site above and has more details:

> **[py5](https://ixora.io/projects/py5/)**
>
> py5

This is the pinned post on top of **p5py** category topic:

> [@About the p5py category](https://discourse.processing.org/t/about-the-p5py-category/23832):
>
> p5py is a Python package based on the core ideas of Processing. It runs directly on Python 3 (rather than in the Processing PDE) and is installable in Python through pip install p5. For related discussions of Processing modes and Python, see Processing.py, aka Python mode for Processing. [https://discourse.processing.org/c/processing-py/9](https://discourse.processing.org/c/processing-py/9)

This is all I can offer on this subject form a quick exploration and search.

`:)`

---

<div class="post-metadata">

### Author: ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)
#### Post date: [June 27, 2025, 1:45pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/12 "2025-06-27T13:45:44Z")

</div>

> [@glv](#):
>
> The **py5** category is the one I have been using

And py5 is actively maintained! There have been two releases this year and there will be several more before the year is over. This is a growing project with a growing community.

---

<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: [August 24, 2025, 4:26pm UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/13 "2025-08-24T16:26:35Z")

</div>

> [@hx2A](#):
>
> And py5 is actively maintained!

Sharing:

[![](https://img.youtube.com/vi/cI6Nby5UXqc/hqdefault.jpg "Talks - James Schmitz: Creative Coding with py5, the Python version of Processing") ](https://www.youtube.com/watch?v=cI6Nby5UXqc)

`:)`

---

<div class="post-metadata">

### Author: ![hx2A](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hx2a/32/14322_2.png) [@hx2A](https://discourse.processing.org/u/hx2A)
#### Post date: [August 25, 2025, 4:07am UTC](https://discourse.processing.org/t/version-of-python-used-in-python-mode/10254/14 "2025-08-25T04:07:23Z")

</div>

Making that presentation was a lot of fun.

I’ll be presenting again at Python Brasil this October. If you are near São Paulo at all, please join us!
