开发者

No module named _core when using mailer.py on Windows/Python 2.7

开发者 https://www.devze.com 2023-04-07 05:42 出处:网络
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

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 i开发者_运维知识库nstalled 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号