python2.7で開発されたpythonパッケージがありますが、python3.6に移植する必要があります。私はコードのいくつかの部分でcythonを使うので、パッケージには.py
と.pyx
の両方のファイルがあります。2to3のpython2からpython3へのcythonファイルの移植
私はコマンドを試しましたが、私は理解も解決もできないというエラーがありました。
例:私は、次のtest.pyx
ファイル
# cython: profile=False
cimport cython
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.profile(False)
cpdef sillyfunction():
print 'Thank you for your kind help'
return
を持っていると私は2to3 test.pyx
を実行します。私が得るものは:
[email protected]:~$ 2to3 test.pyx
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Can't parse test.pyx: ParseError: bad input: type=1, value=u'cython', context=(u' ', (2, 8))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse test.pyx: ParseError: bad input: type=1, value=u'cython', context=(u' ', (2, 8))