67

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

I have my python source under the path

/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

/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?

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Durgesh Tanuku
  • 1,124
  • 2
  • 10
  • 26
  • PYTHONPATH should contain the directories that modules are in. Did you add to PYTHONPATH or overwrite it? Suggest you just add, unless you have more than one copy of the standard library modules. – cdarke Jun 27 '15 at 08:07
  • Before I have set the PYTHONPATH it was empty. Just I have given my path using export. – Durgesh Tanuku Jun 27 '15 at 08:10
  • I have tried by appending /usr/local/lib/python2.7/dist-packages/futures to the PYTHONPATH. But now I am getting a different error: ImportError: /usr/local/lib/python2.7/dist-packages/lxml/etree.so: undefined symbol: PyUnicodeUCS4_DecodeLatin1 – Durgesh Tanuku Jun 27 '15 at 08:19
  • Try `/usr/local/lib/python2.7/dist-packages/` – cdarke Jun 27 '15 at 10:35
  • Already tried that.. But no progress – Durgesh Tanuku Jun 27 '15 at 10:48
  • Actually, the undefined symbol is probably not the PYTHONPATH, it looks like a library incompatibility. Sorry to mislead you. See http://stackoverflow.com/questions/6806831/ubuntu-11-04-lxml-import-etree-problem-for-custom-python – cdarke Jun 27 '15 at 10:54

1 Answers1

126

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

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.

Samuel Dauzon
  • 10,744
  • 13
  • 61
  • 94