Jump to content

How to use or download Python Libraries in Streambase?


Yasemin Alpay

Recommended Posts

Hi Andy,

Thank you for your prompt response.

We are using some libraries which are not build-in python, however we are working on a server which can't use pip install.

So, we are trying to import these libraries manually.

  • How can we use the library we imported, is there a place for python library folders in streambase?
  • We are using Maven for java libraries, is there a similar way for python?
  • Additionally, can we install the libraries in Streambase itself?

Thank you in advanced.

Kind Regards,

Yasemin

Link to comment
Share on other sites

Hi Yasemin,

There is a sample for using Python operators in the project. If you go to File > Import Samples and Community Content and then in the list type python you will see one called "Using python operators for modeling or other tasks". Go ahead and import that if you haven't already.

Inside that sample there are a couple of EventFlows that show how to use the Python operators. You will see they have a link to a configuration file called Python.conf which you can find under src/main/configurations. If you open that up, there is a section down below where it says executable = "C:/Python36/python.exe".

Sorry for the long preamble, but this configuration points at your python environment on the machine. This is an example, but make sure you point it to the exact path of where your python.exe is located, once you have set it up. But this is also where you will install your python dependencies, and you can do that by launching the python.exe environment and applying whatever commands you need to install your libraries. Normally we would use pip for this, but you mention you cannot use this, so this might require some more research to install your libs. But that will be 100% python commands, nothing to do with Streaming. Once you've set things up and tested your code just in the python console, then it should be fine inside Streaming because it will use the same environment with the same libs.

Thanks,

Glenn

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...