ImportError: cannot import name create_string_buffer

Viewed 28

I'm using python script in mulesoft ,while importing a library the above error is occuring? Any help would be much appreciated . Below is the error I get:

Message : ImportError: cannot import name create_string_buffer in at line number 2

Element : pythondemoFlow/processors/2/processors/1 @ pythondemo:pythondemo.xml:27 (Execute)

2 Answers

If you are trying to import ctypes into your script, it will not work. Python support in Mule depends on the Jython implementation which doesn't really supports ctypes. See Using ctypes with jython for more information.

Have you set the python.path property? As explained here it looks like this is what you might be missing.

In Cloudhub

Define the Cloudhub property for python.path to /opt/mule/mule-CURRENT/apps/<APPNAME>/classes in the application settings.

On Premise

Set the property by adding it to the wrapper.conf file.
For example: wrapper.java.additional.=-Dpython.path=/path/to/your/libraries

Related