juliema/aTRAM

incompatibility issue with python 3.7?

Closed this issue · 2 comments

setting up a virtualenv with 3.7 throws an error with psutil

test$ python3.7 -m venv venv3.7
test$source venv3.7/bin/activate
test$ pip install -r ../aTRAM/requirements.txt

Collecting biopython>=1.74 (from -r ../aTRAM/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/7d/2a/48ef94adf91c079bb7a97b38193a06735e1c41fbc19ee57edd8bebd6c6fa/biopython-1.76-cp37-cp37m-manylinux1_x86_64.whl (2.3MB)
100% |████████████████████████████████| 2.3MB 473kB/s
Collecting numpy>=1.17.3 (from -r ../aTRAM/requirements.txt (line 2))
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/63/0c/0261693cc3ad8e2b66e66dc2d2676a2cc17d3efb1c58a70db73754320e47/numpy-1.18.1-cp37-cp37m-manylinux1_x86_64.whl (20.1MB)
100% |████████████████████████████████| 20.1MB 58kB/s
Collecting psutil>=5.6.3 (from -r ../aTRAM/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz (449kB)
100% |████████████████████████████████| 450kB 1.9MB/s
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
Complete output from command /home/data/psocodea_test/venv3.7/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-9jx3ub2q/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmp1mf_mqbapip-wheel- --python-tag cp37:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: numpy, biopython, psutil
Running setup.py install for psutil ... error
Complete output from command /home/data/psocodea_test/venv3.7/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-9jx3ub2q/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-94oczby8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/data/psocodea_test/venv3.7/include/site/python3.7/psutil:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psaix.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/init.py -> build/lib.linux-x86_64-3.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.7/psutil
creating build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/main.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/init.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.7/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.7/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/psutil
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 -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/home/data/psocodea_test/venv3.7/include -I/usr/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.7/psutil/_psutil_common.o
psutil/_psutil_common.c:9: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

----------------------------------------

Command "/home/data/psocodea_test/venv3.7/bin/python3.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-9jx3ub2q/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-94oczby8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/data/psocodea_test/venv3.7/include/site/python3.7/psutil" failed with error code 1 in /tmp/pip-build-9jx3ub2q/psutil/

The issue is that you need to install the development version of python. Some libraries link again that.

On Ubuntu:
sudo apt install python3.7-dev

On Mac, I'm unsure, but I think you can do it thru the brew installer.

installed the dev version of python on wallace. Fixed