Pysam installation error

838 views
Skip to first unread message

KJ Lim

unread,
Jul 17, 2014, 3:31:01 AM7/17/14
to pysam-us...@googlegroups.com
Dear Pysam developers & community,

Good day.

I got error messages when installing pysam (pip install pysam) on Ubuntu 12.04 64-bit machine.

The error messages are:

$ sudo pip install pysam

Downloading/unpacking pysam
  Downloading pysam-0.8.0.tar.gz (1.2MB): 1.2MB downloaded
  Running setup.py (path:/tmp/pip_build_root/pysam/setup.py) egg_info for package pysam
   
    warning: no files found matching 'tests/pysam_data'
    warning: no files found matching 'tests/tabix_data'
Downloading/unpacking cython>=0.20.1 (from pysam)
  Downloading Cython-0.20.2.tar.gz (1.4MB): 1.4MB downloaded
  Running setup.py (path:/tmp/pip_build_root/cython/setup.py) egg_info for package cython
.
.
.
.
.
​.
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE= -Isamtools -Ipysam -I/usr/include/python2.7 -c pysam/csamtools.c -o build/temp.linux-x86_64-2.7/pysam/csamtools.o -Wno-error=declaration-after-statement

pysam/csamtools.c:16:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pysam/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-g6QS8p-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pysam


Could someone please sharing with me your experience how to solve the problem like this?

Thank you.

Best regards,
KJ Lim

Saket Choudhary

unread,
Jul 17, 2014, 3:44:44 AM7/17/14
to pysam-us...@googlegroups.com

Hi Kean,

This should fix it:

sudo apt-get install python-dev

Saket

--
You received this message because you are subscribed to the Google Groups "Pysam User group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysam-user-gro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

KJ Lim

unread,
Jul 17, 2014, 4:55:30 AM7/17/14
to pysam-us...@googlegroups.com
Dear Saket,

Thanks for the solution. Indeed, it fixed.
Thanks a lot.

Best regards,
KJ Lim
Reply all
Reply to author
Forward
0 new messages