3

I'm trying to configure and run SVN post-commit hook sending mails. I've downloaded class mailer.py, installed Python 2.7 and svn-win32 bindings for svn. The machine is Windows-7 64 bit, the Python is 32 bit. Now the mailer.py ends with error, which is caused by import problem.

When I in python console type "import svn.core" I have following error:

>>> import svn.core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\tools\Python27\lib\site-packages\svn\core.py", line 19, in <module>
    from libsvn.core import *
  File "c:\tools\Python27\lib\site-packages\libsvn\core.py", line 5, in <module>
    import _core
ImportError: No module named _core

while in directory site-packages/libsvn are files such as: _core.dll

I've installed other bindings, pysvn, that was installed correctly, but as far as I've noticed, it's the totally other API so I can't use that for python.py

Does someone had similar problem and knows how to deal with it?

Danubian Sailor
  • 1
  • 38
  • 145
  • 223

2 Answers2

2

The Python bindings need to load the native Subversion libraries (DLL's). If your Python is 32-bit then you would need 32-bit versions of the native Subversion libraries on PATH.

Mark Phippard
  • 10,329
  • 2
  • 32
  • 42
0

I have problem like this. Trouble was that python just can not import this library (svn.core and other).

I just make:
import sys
sys.path.append("C:\csvn\lib\svn-python").

My file core.pyc was in C:\csvn\lib\svn-python\svn. Hope it helps somebody. Such behacior for me is strange because there is no "init.py" or "init.pyc" file in svn-python directory. But it works.