如何使用Cython安装setup.py的模块?

时间:2013-08-25 15:44:55

标签: python python-3.x cython

首先我没有使用python的经验。我只想在blender中安装一个带有setup.py的模块。似乎我需要Cython来安装它。我将Cython添加到PYTHONPATH,将bin文件夹添加到PATH。显示此错误:

python setup.py install
running install
running build
running build_ext
Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    cmdclass = {'build_ext': build_ext})
  File "C:\Python33\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python33\lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Python33\lib\distutils\command\install.py", line 569, in run
    self.run_command('build')
  File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Python33\lib\distutils\command\build.py", line 126, in run
    self.run_command(cmd_name)
  File "C:\Python33\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Python33\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 163, in run
    _build_ext.build_ext.run(self)
  File "C:\Python33\lib\distutils\command\build_ext.py", line 354, in run
    self.build_extensions()
  File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 170, in build_extensions
    ext.sources = self.cython_sources(ext.sources, ext)
  File "C:\Cython-0.19.1\Cython\Distutils\build_ext.py", line 181, in cython_sources
    from Cython.Compiler.Main \
  File "C:\Cython-0.19.1\Cython\Compiler\Main.py", line 302
    except UnicodeDecodeError#, e:
                                 ^
SyntaxError: invalid syntax

版本是:Python 3.3 / Windows7 64 / Cython-0.19.1

任何想法,我应该尝试什么?

1 个答案:

答案 0 :(得分:1)

看起来你的Cython安装在某种程度上受损了。您可能需要考虑从Cython Windows installer for Python 3.3获得全新安装。