gpt4 book ai didi

python - 在非英语 Ubuntu 上编译 Cython .pyx 文件(unicode 错误)

转载 作者:太空宇宙 更新时间:2023-11-04 06:00:51 24 4
gpt4 key购买 nike

所以,我猜这是其中一个相关数据包中的错误,我想报告它,但我真的不明白错误到底在哪里,所以我试图定义它并描述解决方案。

我最近升级到 Ubuntu 14.4 并且很高兴能够以我自己的语言使用它,当我遇到错误时,这是​​由于语言更改:

尝试使用 distutils 编译 cython .pyx 文件时,如果文件位于某个路径中,则编译会因 unicode 错误 中止,其中包括非 ascii 符号。在我的例子中,桌面路径已重命名为德语版本 "Arbeitsfläche",编译时似乎存在问题。

谁能告诉我这是一个错误还是一个功能(如果是前者,在哪里提交)?

完整性堆栈跟踪:

Compiler crash traceback from this point on:
File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Nodes.py", line 6785, in analyse_declarations
module_scope = env.find_module(self.module_name, self.pos)
File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Symtab.py", line 1089, in find_module
module_name, relative_to = self.parent_module, pos = pos)
File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 132, in find_module
pxd_pathname = self.find_pxd_file(qualified_name, pos)
File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 184, in find_pxd_file
pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=True)
File "/usr/lib/python2.7/dist-packages/Cython/Compiler/Main.py", line 225, in search_include_directories
tuple(self.include_directories), qualified_name, suffix, pos, include, sys_path)
File "/usr/lib/python2.7/dist-packages/Cython/Utils.py", line 16, in wrapper
res = cache[args] = f(*args)
File "/usr/lib/python2.7/dist-packages/Cython/Utils.py", line 101, in search_include_directories
path = os.path.join(dir, dotted_filename)
File "/usr/lib/python2.7/posixpath.py", line 80, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

编辑 18.8.2014

可以找到一个最小的例子here .似乎 import cython 语句触发了该行为。

最佳答案

我已经成功编译了 your example在我将参数替换为 setup

之后
ext_modules=linext,
cmdclass = {'build_ext': build_ext}

使用 current cython documentation 中鼓励的版本:

ext_modules=cythonize(linext)

根据您找到版本的位置,Cython 中确实存在错误,或者您只是尝试了一些不起作用的东西。

关于python - 在非英语 Ubuntu 上编译 Cython .pyx 文件(unicode 错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25141838/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com