Home > Back-end >  how to install futures in Python3.9?
how to install futures in Python3.9?

Time:12-07

I use Python 3.9. I need use from concurrent.futures import ThreadPoolExecutor so I try add futures in requirements.txt and I try again pip install futures

I have this error:

Collecting futures
  Using cached futures-3.0.5.tar.gz (25 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [25 lines of output]
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 14, in <module>
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\__init__.py", line 18, in <module>
      from setuptools.dist import Distribution
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 32, in <module>
      from setuptools.extern.more_itertools import unique_everseen
    File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
    File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
    File "<frozen importlib._bootstrap>", line 565, in module_from_spec
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\extern\__init__.py", line 52, in create_module
      return self.load_module(spec.name)
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\extern\__init__.py", line 37, in load_module
      __import__(extant)
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_vendor\more_itertools\__init__.py", line 1, in <module>
      from .more import *  # noqa
    File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\_vendor\more_itertools\more.py", line 5, in <module>
      from concurrent.futures import ThreadPoolExecutor
    File "C:\Users\me\AppData\Local\Temp\pip-install-luq80xmi\futures_5f788c9dc96c4342b3e40d9911025d72\concurrent\futures\__init__.py", line 8, in <module>
      from concurrent.futures._base import (FIRST_COMPLETED,
    File "C:\Users\me\AppData\Local\Temp\pip-install-luq80xmi\futures_5f788c9dc96c4342b3e40d9911025d72\concurrent\futures\_base.py", line 357
      raise type(self._exception), self._exception, self._traceback
                                 ^
  SyntaxError: invalid syntax
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

CodePudding user response:

concurrent.futures is standard library and does not need to be installed.

If you are referring to this package: https://pypi.org/project/futures/ then it's back ported version of concurrent.futures to python 2 and does not work on python 3 (stated by the project description itself).

  • Related