Question

Python Module Install


Badge +1
I would like to use the Python adodbapi module in my FME script. I have this module installed on my system, but it is for Python 2.6, which is the version that ArcGIS installs. The FME Python version is 2.7 and when I try to install adodbapi for Python 2.7, the installer says that Python 2.6 is found in the registry and will not install it.

 

 

I have also tried changing the Python interpreter in FME to point to the Python 2.6 interpreter that ArcGIS installs, but FME says that this version of the Python interpreter is not supported. I've also tried appending to sys.path and setting the PYTHONPATH, but nothing works. Looks like I need adodbapi for Python 2.7 installed in the folder for FME, which is FME\\fmepython27.

 

 

Any suggestions?

 

 

Thanks

3 replies

Userlevel 4
Hi,

 

 

you will have to modify the registry so that the Python location points to the installation under the FME directory, before running the regular library installer.

 

 

The installer should then say that Python was found in a subdirectory of the FME installation.

 

 

David
Userlevel 4
For reference, here are the registry keys to modify before installing 3rd party modules into the FME Python interpreter.

 

 

For 64-bit windows:
  • HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Python\\PythonCore\\2.7\\InstallPath

 

For 32-bit windows:
  • HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath

 

Make the "(Default)" key point to <fmedir>\\fmepython27

 

 

This will enable most Python module installer to install into the correct location.

 

 

The above is valid for FME 2013 that ships with Python 2.7. Modify accordingly for other versions.

 

 

David
Badge +1
This didn't quite work for me. I set the registry key as suggested but could not install adodbapi for Python 2.7. Next I recreated the 2.6 keys under Python->PythonCore, only for 2.7. Then adodbapi installed in the FME site-packages folder.

 

 

However, when I run the startup script in FME it says:

 

 

"exception in import Module use of python26.dll conflicts with this version of Python."

 

 

Looking at sys.path, the two first paths are to the ArcGIS10 version of Python. I tried to override this by the following at the top of my script:

 

 

sys.path.insert(0,r"C:\\Program Files (x86)\\FME\\fmepython27\\Lib\\site-packages") sys.path.insert(1,r"C:\\Program Files (x86)\\FME\\fmepython27\\Lib\\site-packages\\win32") sys.path.insert(2,r"C:\\Program Files (x86)\\FME\\fmepython27\\Lib\\site-packages\\win32\\lib")

 

 

However, when I do that I get the error, 

 

 

"The program can't start because MSVCR90.dll is missing from your computer".

 

 

However, it does exist because I can execute the program directly from the command line. I copied it from the ArgGIS folder and put it in the FME dll folder, but got the same error.

 

 

Looks like some setting is still pointing to the ArcGIS site-packages folder. This means I can't use any 3rd party Python modules from FME when I have ArcGIS installed.

 

 

Thanks for your help.

Reply