Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top