1

I've just downloaded pyFileMaker. I copied the directory PyFileMaker into the dir Lib under Python31 directory, but when I simply include the module FMServer with this line:

from PyFileMaker import FMServer

I get this error

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from PyFileMaker import FMServer
  File "C:\Python31\lib\PyFileMaker\__init__.py", line 17
    print "Unable to load the EXPAT library. You need to have it installed"

I checked whether the module expat exists and, infact, it exists. How can I fix this?

skaffman
  • 398,947
  • 96
  • 818
  • 769
alkz
  • 337
  • 2
  • 7
  • 17

1 Answers1

0

Well, as far as I can see the error happened not in the import, but in the print statement. (I.e. there probably was an error in import too, but it was intercepted.) The problem is that PyFileMaker is written for Python 2.x (their site says 2.4 is the minimal version), while you're using Python 3, and v3 is not compatible with v2.x.

I'd suggest switching to Python v2.7 (which is the primary version at the moment anyway). If you really want to use v3, you might try to convert the file with the 2to3 converter, but there's no guarantee it's going to work.

Mikhail Edoshin
  • 2,639
  • 16
  • 25