Hi,
that depends entirely on how the osgeo installer works, as there are several installer types in use with different prerequisites. For a lot of use cases you can follow this:
http://fmepedia.safe.com/articles/How_To/Install-Python-modules-into-FME
For the cases where this isn't possible, I recommend that you download and install a free-standing version of Python (from
https://www.python.org/) that matches the one delivered with FME (usually version 2.7). You then configure FME to use this Python interpreter (see:
http://fmepedia.safe.com/articles/How_To/Choosing-a-different-Python-Interpreter-installation), where you finally install your 3rd party modules.
David
Hi David,
Thanks for that. I didn't manage to find the first link during my searches. The downside to this method is - I don't seem to actually be able to find the Python osgeo package downloadable online.
I guess it came with the OSGeo4W installer maybe. Hmmm.
----
I've tried the second method, with a confirmed working install of Python 2.7 (already installed) that has the package installed within it.
Problem is, FME fails to run when using this method:
2015-01-14 17:02:15| 1.5| 0.0|ERROR |The User-specified library C:\\Python27\\python27.dll could not be loaded
2015-01-14 17:02:15| 1.5| 0.0|INFORM|Using user-specified Python interpreter from C:\\Python27\\python27.dll
2015-01-14 17:02:15| 1.5| 0.0|FATAL |A Python installation could not be detected. PythonFactory could not initialize
---
Finally, from (
http://fmepedia.safe.com/articles/How_To/Python-on-FME-Server#heading_toc_j_1 (I figured I'd give it a try on Desktop)) I've also tried to copy and paste the module directory from the 2.7 install into the FME Python directory. but this just gives me a different error again:
2015-01-14 17:06:19| 2.8| 0.1|ERROR |Python Exception <ImportError>: DLL load failed: %1 is not a valid Win32 application.
So all in all, I'm afraid I remain very confused. :-(
Any thoughts on any of these?
Thanks,
Jonathan
Hi,
could it be that your installation of Python 2.7 in C:\\Python27 is a 64-bit version? You will need a 32-bit version of Python for 32-bit FME.
David
Hi David,
Good thought. I don't know the python version, so tested against both FME versions:
FME 32bit error:
2015-01-14 17:25:20| 1.6| 0.0|ERROR |The User-specified library C:\\Python27\\python27.dll could not be loaded
2015-01-14 17:25:20| 1.6| 0.0|INFORM|Using user-specified Python interpreter from C:\\Python27\\python27.dll
2015-01-14 17:25:20| 1.6| 0.0|FATAL |A Python installation could not be detected. PythonFactory could not initialize
=============
FME 64bit result:
2015-01-14 17:26:29| 1.5| 0.0|INFORM|Using user-specified Python interpreter from C:\\Python27\\python27.dll
2015-01-14 17:26:29| 1.5| 0.0|INFORM|Python version 2.7 successfully loaded
2015-01-14 17:26:29| 1.6| 0.1|WARN |Warning: not all FMESessions that were created were destroyed before shutdown. This may cause instability
ImportError: No module named site
and then the translation ends with nothing else in the log!
So it may be 64bit, but I'm just getting a different error! :-(
Thoughts still welcome! :-)
Thanks,
Jonathan
Hi,
you should check the version by double-clicking on python.exe and see what it says:
David
Yup, 64bit:
Enthought Python Distribution -- www.enthought.com
Version: 7.2-1 (64-bit)
Python 2.7.2 |EPD 7.2-1 (64-bit)| (default, Sep 14 2011, 11:25:00) :MSC v.1500 6
4 bit (AMD64)] on win32
Type "packages", "demo" or "enthought" for more information.
There you have the explanation.
32-bit FME needs 32-bit Python.
David
Alas no. Remember that 64bit FME with 64bit python was giving me this; which is arguably even worse because it's failing without saying it's failing.
FME 64bit result:
2015-01-14 17:26:29| 1.5| 0.0|INFORM|Using user-specified Python interpreter from C:\\Python27\\python27.dll
2015-01-14 17:26:29| 1.5| 0.0|INFORM|Python version 2.7 successfully loaded
2015-01-14 17:26:29| 1.6| 0.1|WARN |Warning: not all FMESessions that were created were destroyed before shutdown. This may cause instability
ImportError: No module named site
and then the translation ends with nothing else in the log!
Hi David,
Thanks for the information.
After further testing:
- Issue happens with both 32bit and 64bit.
- Anaconda Python gets the exact same error as Enthought.
- The "site" module is loaded and works fine when I use python.exe in my install and then "import site".
I did manage to find an OSGEO package, but the method from the link -
http://fmepedia.safe.com/articles/How_To/Install-Python-modules-into-FME - doesn't work because it seems end up trying to compile the OSGEO thing.
So, I'm afraid I seem to be no closer to finding the solution to this issue than I was when I started this.
Any thoughts welcome!
Thanks,
Jonathan
Hi,
you probably need to find a pre-compiled version of osgeo.
If it's GDAL you need, have a look here for a starting point:
https://pypi.python.org/pypi/GDAL/
David