我的 pysvn 模块在 Python 2.7.1 中运行良好,但它拒绝在 Python 3.2 中导入。它是用 apt-get 安装的,所以我认为它应该适用于两者。
xxxxx:~$ python
Python 2.7.1+ (r271:86832, Sep 27 2012, 21:12:17)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
>>> exit()
xxxxx:~$ python3
Python 3.2 (r32:88445, Oct 20 2012, 14:09:29)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pysvn
>>> exit()
编辑:我也试过通过 pip 安装 3.2 版本,结果如下
xxxxx:~$ sudo pip-3.2 install http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.8.tar.gz Downloading/unpacking http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.8.tar.gz
Downloading pysvn-1.7.8.tar.gz (347kB): 347kB downloaded
Running setup.py egg_info for package from http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.8.tar.gz
Cleaning up...
xxxxx:~$ python3
Python 3.2 (r32:88445, Oct 20 2012, 14:09:29)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysvn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pysvn