可以分发setuptools的可用于在Python 2实施3口包 [英] Can distribute setuptools be used to port packages implemented in python 2 to 3

查看:120
本文介绍了可以分发setuptools的可用于在Python 2实施3口包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发现使用分布在以下链接setuptools的蟒蛇从2移植包3的一些信息。

Found some info on porting packages from python 2 to 3 using distribute setuptools in below link.

http://packages.python.org/distribute/python3.html

我有一个C API,它可以建立使用python 2.x中,但我需要建立它在Python 3.x中
它可以使用分配来完成。

I have a C api which could be build using python 2.x, but i need to build it in python 3.x. Can it be done using distribute.

不要任何人有这样的想法?

Do anyone have idea on this?

推荐答案

没有,它不能使用分发完成。分发只是调用在构建阶段的 2to3的剧本,但 2to3的可以的Python 2.x的源文件和之间只能转换Python 3.x都有源文件。对于C API,你必须手动调整您的code用Python的API来编译做了艰辛的道路。

No, it cannot be done using Distribute. Distribute just calls the 2to3 script in the build phase, but 2to3 can convert only between Python 2.x source files and Python 3.x source files. For the C API, you have to do it the hard way by manually tweaking your code to compile with both Python APIs.

Python的2.x和Python 3.x都有之间的C API的变化非常不完整的名单中发现的此处。同样的文件还概述了对Python源$ C ​​$ C级的Python 2.x和3.x之间的主要区别。

A very incomplete list of C API changes between Python 2.x and Python 3.x is to be found here. The same document also outlines the major differences between Python 2.x and 3.x on the Python source code level.

这篇关于可以分发setuptools的可用于在Python 2实施3口包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆