0

首先,我没有使用 python 的经验。我只想在带有 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

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

4

1 回答 1

1

看起来您的 Cython 安装以某种方式损坏了。您可能需要考虑重新安装,可能来自Python 3.3 的 Cython Windows 安装程序

于 2013-08-26T01:47:15.373 回答