Question

Python Libraries on FME Cloud

  • 24 November 2014
  • 6 replies
  • 10 views

My workspace relies on some non-standard python libraries, is there a way to either include these in my workspace when I push to FME Server on the FME Cloud, or otherwise install these python modules on the FME Cloud?

6 replies

Userlevel 5
Hi,

 

 

sorry, I don't think that's possible without the intervention of Safe.

 

 

Contact their support (https://safecommunity.force.com/knowledgeSubmitCase) and ask.

 

 

David

I have gotten this to work recently without intervention. 

Firstly, download the python source code for the library you want to upload (i.e. don't pip install it). 

On a linux machine (I used ubuntu-14.04.3-desktop-amd64 on a virtual machine), compile the library by navigating the library root folder and

 sudo python setup.py install

It will display the site-packages folder that it creates the library files in. 

What you will need to do after this is upload the entire library folder (for example pandas) to the Resources>Engine>Plugins>Python>Python27 folder on FME Cloud. Navigate to that folder, highlight Python27, then click "upload" in the top left of the resources container. Once there upload the folder. Now you can call it as you would normally in your python script using

import
Userlevel 5

I have gotten this to work recently without intervention. 

Firstly, download the python source code for the library you want to upload (i.e. don't pip install it). 

On a linux machine (I used ubuntu-14.04.3-desktop-amd64 on a virtual machine), compile the library by navigating the library root folder and

 sudo python setup.py install

It will display the site-packages folder that it creates the library files in. 

What you will need to do after this is upload the entire library folder (for example pandas) to the Resources>Engine>Plugins>Python>Python27 folder on FME Cloud. Navigate to that folder, highlight Python27, then click "upload" in the top left of the resources container. Once there upload the folder. Now you can call it as you would normally in your python script using

import

Thanks for posting, this functionality has indeed been much improved since my original reply.

Userlevel 4
Badge +13

Here are some instructions I wrote up previously.

 

Example

https://pypi.python.org/pypi/PyExecJS

Instructions

FME Desktop:

  • Open command prompt
  • cd to directory with where setup.py is located
    • Windows: fme.exe python easy_install PyExecJs
    • Linux: fme python easy_install PyExecJs

https://www.dropbox.com/s/zi09xcgus1ysten/Screenshot%202015-08-28%2017.24.49.png?dl=0

FME Server:

  • Use FME Desktop to install your package.
  • Find the Python site-packages directory
    • Windows: (FMEDir)\\python\\python27 (?)
    • Mac: /Library/Python/2.7/site-packages
  • locate the directory that contains the init.pyc and main.pyc files for your package
  • Open Web UI > Resources > Engine > Plugins > python > python27
  • Upload the directory with the .pyc files.
Badge +7

Here are some instructions I wrote up previously.

 

Example

https://pypi.python.org/pypi/PyExecJS

Instructions

FME Desktop:

  • Open command prompt
  • cd to directory with where setup.py is located
    • Windows: fme.exe python easy_install PyExecJs
    • Linux: fme python easy_install PyExecJs

https://www.dropbox.com/s/zi09xcgus1ysten/Screenshot%202015-08-28%2017.24.49.png?dl=0

FME Server:

  • Use FME Desktop to install your package.
  • Find the Python site-packages directory
    • Windows: (FMEDir)\\python\\python27 (?)
    • Mac: /Library/Python/2.7/site-packages
  • locate the directory that contains the init.pyc and main.pyc files for your package
  • Open Web UI > Resources > Engine > Plugins > python > python27
  • Upload the directory with the .pyc files.

 

Does this methode work for FME Cloud (and R)?
Badge

 

Does this methode work for FME Cloud (and R)?
Please check out this Q&A;: https://knowledge.safe.com/questions/52034/r-packages-and-python-libraries-are-available-on-f.html

 

 

Reply