SVG library doesn't work in Python mode?

I’ve tried

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


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

What am I doing wrong?

1 Like

print PGraphicsSVG

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:

import datetime
print( )

from datetime import date
print( )

from Animal import Lion

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” I get “Exception: This sketch requires the “svg” library. at 10:0 in”.

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