# SVG library doesn't work in Python mode?

**URL:** https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270
**Category:** Processing.py
**Created:** [April 14, 2019, 5:45pm UTC](https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270 "2019-04-14T17:45:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Raums](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Raums](https://discourse.processing.org/u/Raums)
#### Post date: [April 14, 2019, 5:45pm UTC](https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270/1 "2019-04-14T17:45:15Z")

</div>

I’ve tried

> from processing.svg import \*  
> which says “import \* does not work in this environment.”

and

> import processing.svg  
> which says “ImportError: No module named svg”

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [April 14, 2019, 6:00pm UTC](https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270/2 "2019-04-14T18:00:40Z")

</div>

[Py.Processing.org/reference/add\_library.html](http://Py.Processing.org/reference/add_library.html)

```auto
add_library('svg')
print PGraphicsSVG

```

> <https://github.com/processing/processing/blob/master/java/libraries/svg/src/processing/svg/PGraphicsSVG.java>

---

<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, 3:47am UTC](https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270/3 "2019-04-15T03:47:35Z")

</div>

To add to @GoToLoop’s response –

If Processing lists the library under the **Sketch \> Import Library…** menu, then you can select it from this menu and have the editor insert the relevant `add_library()` line for you.

Use `import` for any standard Python libraries or custom classes you have created. For example:

```auto
import datetime
print( datetime.date.today() )

from datetime import date
print( date.today() )

from Animal import Lion
...

```

---

<div class="post-metadata">

### Author: ![Raums](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Raums](https://discourse.processing.org/u/Raums)
#### Post date: [November 22, 2019, 8:29am UTC](https://discourse.processing.org/t/svg-library-doesnt-work-in-python-mode/10270/4 "2019-11-22T08:29:33Z")

</div>

add\_library(‘svg’) works when I run it in the processing IDE, but I’m using Visual Studio now and when I run the same exact code from the terminal using “java -jar processing-py.jar star\_generator\_2.py” I get “Exception: This sketch requires the “svg” library. at 10:0 in star\_generator\_2.py”.

I’ve tried using “from processing import svg” as well without luck. How do I get this working in my IDE?
