Score:-1

Problem using pip3 to install mdanalysis

cn flag

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

Score:-1
cn flag

After posting this, I found the answer, so I'll post it, in the hopes of helping other confused grampas. As you can see here:

"'"'\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

It was trying to use the python3.8-dev package so when you do:

sudo apt-get install python3-dev

make sure you install the python-dev package the error message is asking you, in this case:

sudo apt-get install python3.8-dev

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.