Skip to main content
Question

Is there a way to use a python virtual environment?


ottadini
Contributor
Forum|alt.badge.img

In FME 2018, I want to use a custom python interpreter, and a specific python virtual environment (conda environments).

How can I do this?

9 replies

ottadini
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • June 13, 2018

Or any kind of virtual environment!

Is there a way to do it using one of the import methods as outlined in this SO Q&A;?

The current means of specifying a 'preferred python interpreter' is not amenable to this kind of thing I guess?


lefred06
Contributor
Forum|alt.badge.img+8
  • Contributor
  • February 7, 2019

Hi there,

We had the same request from one of our (big) customers.

Any clue would be welcome, thanks !


ottadini
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • February 12, 2019
lefred06 wrote:

Hi there,

We had the same request from one of our (big) customers.

Any clue would be welcome, thanks !

I've not progressed this myself, so any information would be great.


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • February 12, 2019

Hi @ottadini & @lefred06

Currently, using Python virtual environments within FME is not a tested scenario. From the development point of view, there would need to be a strong use case/motivation for officially supporting Python virtual environments within FME as it is not a typical or accepted way of invoking Python from an application. I recommend posting an Idea if you would like to see this functionality offically supported in FME.

I would also recommend reading this Q&A post about configuring Anaconda environment for some tips/suggestions.


  • February 6, 2020
debbiatsafe wrote:

Hi @ottadini & @lefred06

Currently, using Python virtual environments within FME is not a tested scenario. From the development point of view, there would need to be a strong use case/motivation for officially supporting Python virtual environments within FME as it is not a typical or accepted way of invoking Python from an application. I recommend posting an Idea if you would like to see this functionality offically supported in FME.

I would also recommend reading this Q&A post about configuring Anaconda environment for some tips/suggestions.

A use case would be to be able to choose between ArcPy 32-bit and 64-bit through different env's, since not all functionality is the same. It is something we're running into currently.


  • February 6, 2020

A (theoretic, not tested yet) solution might be to safe the python script externally and call it through a systemCaller with can take an argument for the environment. Depending on the script this might be feasible.


Forum|alt.badge.img
  • February 6, 2020

In my case, I'm calling the Python script with custom interpreter from a batch file.


paalped
Contributor
Forum|alt.badge.img+5
  • Contributor
  • February 7, 2020

My initial thought some time back was to parameterize Python interpreter and Python home settings. Why this idea: https://knowledge.safe.com/content/idea/81345/parameterize-python-interpreter.html. Back then I though Python could be more loosly coupled to FME, but im not sure if its possible to make that work.


mccunee
Contributor
Forum|alt.badge.img+2
  • Contributor
  • April 16, 2024
zwemmerb wrote:
debbiatsafe wrote:

Hi @ottadini & @lefred06

Currently, using Python virtual environments within FME is not a tested scenario. From the development point of view, there would need to be a strong use case/motivation for officially supporting Python virtual environments within FME as it is not a typical or accepted way of invoking Python from an application. I recommend posting an Idea if you would like to see this functionality offically supported in FME.

I would also recommend reading this Q&A post about configuring Anaconda environment for some tips/suggestions.

A use case would be to be able to choose between ArcPy 32-bit and 64-bit through different env's, since not all functionality is the same. It is something we're running into currently.

There are many use cases for needing virtual environments, not just with arc. Virtual environments or docker images are incredibly important for maintaining environments amongst large teams and ensuring smooth deployments of applications.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings