This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ImportError: No module named 'concurrent.futures'
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Bill.Bergmann, Claudiu.Popa, ned.deily
Priority: normal Keywords:

Created on 2014-04-28 21:02 by Bill.Bergmann, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg217418 - (view) Author: Bill Bergmann (Bill.Bergmann) Date: 2014-04-28 21:02
python 3.4 attempting to run example at https://docs.python.org/3/library/concurrent.futures.html
17.4.2.1

$ python3 17_4_2.py 
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 2195, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "17_4_2.py", line 1, in <module>
    import concurrent.futures
ImportError: No module named 'concurrent.futures'; 'concurrent' is not a package

os: OS X 10.6

from $env:
PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin: ...

PYTHONPATH=/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/: ...
msg217420 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-04-28 21:06
Do you have a module/file named concurrent.py in your PATH?
msg217422 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-04-28 21:13
FWIW, works for me using the python.org 3.4 64-bin installer.  What is the output of:

python3 -c 'import sys;print(sys.version)'

As Claudiu suggests, check for a concurrent.py shadowing the standard library version.

Also, why are you setting PYTHONPATH to include /Library/Frameworks/Python.framework/Versions/{3.4,2.7}/lib/python3.4/site-packages/?  Those are the standard locations for site-packages are included automatically in sys.path by the respective interpreters.  Setting PYTHONPATH should not normally be needed.
msg217529 - (view) Author: Bill Bergmann (Bill.Bergmann) Date: 2014-04-29 16:35
Thank you for your response. The program works as expected.

I removed PYTHONPATH settings for 3.4 and 2.7. I'm not sure how those settings were written. I suspect something related to virtualenv, and I will be watching to see if they are written again.

When I removed those paths, an error message pointed me to a local version of concurrent.py from tornado that was shadowing the concurrent.py in the python3.4 site-packages.
History
Date User Action Args
2022-04-11 14:58:02adminsetgithub: 65577
2014-04-29 16:35:50Bill.Bergmannsetstatus: open -> closed
resolution: not a bug
messages: + msg217529
2014-04-28 21:13:47ned.deilysetnosy: + ned.deily
messages: + msg217422
2014-04-28 21:06:30Claudiu.Popasetnosy: + Claudiu.Popa
messages: + msg217420
2014-04-28 21:02:30Bill.Bergmanncreate