简体   繁体   English

如何在python 3.x中使pip安装python 2.x模块

[英]How to make pip install python 2.x modules in python 3.x

我想使用pip安装邮件库,但是它导入了Queue模块,该模块已在python 3中重命名为queue,如何使用pip下载它?

Answer: You cannot! 答: 不能! Why would you even consider such thing? 你为什么还要考虑这样的事情?

This why so many project still use Python 2.7 and not 3.4, because so many modules are not ported yet. 这就是为什么这么多的项目仍然使用Python 2.7而不是3.4的原因,因为还没有移植这么多的模块。 However, more and more are, especially the famous ones. 但是,越来越多的人,尤其是著名的人。

The only thing you can do, is to find an equivalent / replacement module doing the same thing. 您唯一可以做的就是找到等效的/替换模块来做同样的事情。

Update: 更新:

For creating queues, you could leverage the Deque (collections.deque) or find some implementations of queues using deque. 为了创建队列,您可以利用Deque (collections.deque)或使用deque找到一些队列实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM