I am trying to install mdanalysis for a university project using the command:
pip3 install --user numpy mdanalysis
Numpy is already installed, so it works fine, but for mdanalysis I get:
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/tmp/pip-install-kpddjyii/mdanalysis_304f5152ac494a7e86bfe16e8b723b16/MDAnalysis/lib/formats -I/home/domenico/.local/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-install-kpddjyii/mdanalysis_304f5152ac494a7e86bfe16e8b723b16/MDAnalysis/lib/formats/include -I/usr/include/python3.8 -c MDAnalysis/lib/formats/libdcd.c -o build/temp.linux-x86_64-3.8/MDAnalysis/lib/formats/libdcd.o -std=c99 -ffast-math -O3 -funroll-loops -fsigned-zeros
cc1: warning: -fassociative-math disabled; other options take precedence
MDAnalysis/lib/formats/libdcd.c:36:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
ERROR: Failed building wheel for mdanalysis
Running setup.py clean for mdanalysis
Failed to build mdanalysis
Installing collected packages: mdanalysis
Running setup.py install for mdanalysis ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kpddjyii/mdanalysis_304f5152ac494a7e86bfe16e8b723b16/setup.py'"'"'; file='"'"'/tmp/pip-install-kpddjyii/mdanalysis_304f5152ac494a7e86bfe16e8b723b16/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-5vlwouu4/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/domenico/.local/include/python3.8/mdanalysis
I saw online that I should install python-dev so I did:
sudo apt-get install python3-dev
but that package was already installed, so I tried to uninstall and install again with:
sudo apt autoremove python3-dev
sudo apt-get install python3-dev
But the problem remained the same. Could someone help? (I am total noob, so explain it to me like I'm a confused Grampa)
Thanks in advance