Skip to main content
Question

Problems by choosing a different Python interpreter


Forum|alt.badge.img

I have the following problem: In my FME workbench I need Python and additional Python modules. Because a few of them cannot be installed with fme easy_install and the FME python interpreter does not accept modules which are manually installed I decided to install Python 2.7 indepently from FME and use its python interpreter.

 

So I installed Python, installed the modules, tested it in the shell by importing the modules and it worked. Then I followed the instruction on https://knowledge.safe.com/articles/814/choosing-a-different-python-interpreter-installati.html and chose the python27.dll instead of the standarized fme python.dll. After that also I tested to import the modules in FME by scripting a Startup Python script but here it says that the modules could not be found.

 

What could be the problem?

5 replies

david_r
Evangelist
  • July 17, 2017

Consider setting the PYTHONHOME environment variable so that it points to your chosen Python installation, e.g.

PYTHONHOME=C:\Python27


Forum|alt.badge.img
  • Author
  • July 19, 2017

Hello @david_r

I setted all the python variables as it should be:

  • Path=........D:\Programme\Python27\;D:\Programme\Python27\Scripts
  • PYTHONHOME=D:\Programme\Python27
  • PYTHONPATH=D:\Programme\Python27

And I also setted the C:/SystemWOW64/python27.dll as the preferred python interpreter.

As a test I opened a new workbench, and implemented a simple python script. Somehow FME uses the wrong .dll (not the one I setted in the FME Options) and the wrong PYTHONHOME although it was setted the right way and I don't know why. Aditionally there is a message 'The user-specified library D:\Programme\FME\fme.exe could not be loaded' in the log file. The whole logifle:

...

START - ProcessID: 10532,
peak process memory usage30908 kB, current process memory usage30832 kB 

FME Configuration: Command
line arguments are `D:\Programme\FME\fme.exe'
`C:\Users\User1\AppData\Local\Temp\3\wb-xlate-XXXXXXX'
`LOG_STANDARDOUT' `YES' `LogCountServerName'
`{XXXXXXX-XXXXXXX-XXXXXXXX}' 

The User-specified library
D:\Programme\FME\fme.exe could not be loaded 

Using Python interpreter
from `D:\Programme\FME\fmepython27\python27.dll' with PYTHONHOME
`D:\Programme\FME\fmepython27' 

Python version 2.7 loaded
successfully 

... 

david_r
Evangelist
  • July 20, 2017
You have to really verify that all your components are either 32- or 64-bits, you cannot mix them:

 

  • FME
  • Python as specified by PYTHONHOME
  • Python.dll

 


david_r
Evangelist
  • July 20, 2017
fmaas90 wrote:

Hello @david_r

I setted all the python variables as it should be:

  • Path=........D:\Programme\Python27\;D:\Programme\Python27\Scripts
  • PYTHONHOME=D:\Programme\Python27
  • PYTHONPATH=D:\Programme\Python27

And I also setted the C:/SystemWOW64/python27.dll as the preferred python interpreter.

As a test I opened a new workbench, and implemented a simple python script. Somehow FME uses the wrong .dll (not the one I setted in the FME Options) and the wrong PYTHONHOME although it was setted the right way and I don't know why. Aditionally there is a message 'The user-specified library D:\Programme\FME\fme.exe could not be loaded' in the log file. The whole logifle:

...

START - ProcessID: 10532,
peak process memory usage30908 kB, current process memory usage30832 kB 

FME Configuration: Command
line arguments are `D:\Programme\FME\fme.exe'
`C:\Users\User1\AppData\Local\Temp\3\wb-xlate-XXXXXXX'
`LOG_STANDARDOUT' `YES' `LogCountServerName'
`{XXXXXXX-XXXXXXX-XXXXXXXX}' 

The User-specified library
D:\Programme\FME\fme.exe could not be loaded 

Using Python interpreter
from `D:\Programme\FME\fmepython27\python27.dll' with PYTHONHOME
`D:\Programme\FME\fmepython27' 

Python version 2.7 loaded
successfully 

... 
You have to really verify that all your components are either 32- or 64-bits, you cannot mix them:

 

  • FME
  • Python as specified by PYTHONHOME
  • Python.dll

 


Forum|alt.badge.img
  • Author
  • July 24, 2017
david_r wrote:
You have to really verify that all your components are either 32- or 64-bits, you cannot mix them:

 

  • FME
  • Python as specified by PYTHONHOME
  • Python.dll

 

That was the problem! Thank you so much!

 

 


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