Python 导入错误:没有名为 concurrent.futures.process 的模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31086530/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 09:27:57  来源:igfitidea点击:

ImportError: No module named concurrent.futures.process

pythonpath

提问by Durgesh

I have followed the procedure given in How to use valgrind with python?for checking memory leaks in my python code.

我已经按照如何在 python 中使用 valgrind 中给出的步骤进行操作用于检查我的 python 代码中的内存泄漏。

I have my python source under the path

我在路径下有我的 python 源代码

/root/Test/ACD/atech

I have given above path in PYTHONPATH. Everything is working fine if I run the code with default python binary, located under /usr/bin/. I need to run the code with the python binary I have build manually which is located under

我已经在PYTHONPATH. 如果我使用位于/usr/bin/. 我需要使用我手动构建的 python 二进制文件运行代码,它位于

/home/abcd/workspace/python/bin/python

Then I am getting the following error

然后我收到以下错误

from concurrent.futures.process import ProcessPoolExecutor
ImportError: No module named concurrent.futures.process

How can I solve this?

我该如何解决这个问题?

采纳答案by Samuel Dauzon

If you're using Python 2.7 you must install this module :

如果您使用的是 Python 2.7,则必须安装此模块:

pip install futures

Futures feature has never included in Python 2.x core. However, it's present in Python 3.x since Python 3.2.

Futures 功能从未包含在 Python 2.x 核心中。但是,它从 Python 3.2 开始就存在于 Python 3.x 中。