linuxubuntupython-3.9pandas-profilingbottleneck

Error installing pandas_profiling with Pip on Ubuntu 20.04


pip install pandas_profiling

fails at

Running setup.py install for Bottleneck ... error ERROR: Command errored out with exit status 1: command: /home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; file='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck cwd: /tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/ Complete output (15 lines): running install running build running build_py running build_ext building 'bottleneck.reduce' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/bottleneck creating build/temp.linux-x86_64-3.9/bottleneck/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/me/venv/lib/python3.9/site-packages/numpy/core/include -I/home/me/venv/include -I/usr/include/python3.9 -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src/reduce.o -O2 In file included from bottleneck/src/reduce.c:1: bottleneck/src/bottleneck.h:4:10: fatal error: Python.h: No such file or directory 4 | #include <Python.h> | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; file='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck Check the logs for full command output.

I am on Ubuntu 20.04 and my python version is-

Python 3.9.0+

I tried installing Bottleneck separately,

pip install Bottleneck --no-cache-dir

but that also gives the same error. Have looked solutions to related topics,

fatal error: Python.h: No such file or directory

setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Failed building wheel for bottleneck error

but no luck. Any help would be appreciated.


Solution

  • So.. finally this is what made it work... had to install python3.9-dev.