choderalab / pymbar

Python implementation of the multistate Bennett acceptance ratio (MBAR)
http://pymbar.readthedocs.io
MIT License
240 stars 93 forks source link

pymbar/_pymbar.c:82:20: fatal error: Python.h: No such file or directory #278

Closed raimon-fa closed 7 years ago

raimon-fa commented 7 years ago

Hi, After installing pymbar I tried to install the Alchemical Analysis package (https://github.com/MobleyLab/alchemical-analysis), but when I type "sudo python setup.py install" I get the error in the title. I tried installing pymbar with conda and pip, with the same result.

In more detail I get :~/$ sudo python setup.py install

running install running bdist_egg running egg_info writing requirements to alchemical_analysis.egg-info/requires.txt writing alchemical_analysis.egg-info/PKG-INFO writing top-level names to alchemical_analysis.egg-info/top_level.txt writing dependency_links to alchemical_analysis.egg-info/dependency_links.txt writing entry points to alchemical_analysis.egg-info/entry_points.txt reading manifest file 'alchemical_analysis.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'alchemical_analysis.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/parser_amber.py -> build/bdist.linux-x86_64/egg/alchemical_analysis creating build/bdist.linux-x86_64/egg/alchemical_analysis/utils copying build/lib.linux-x86_64-2.7/alchemical_analysis/utils/zeroxvg.py -> build/bdist.linux-x86_64/egg/alchemical_analysis/utils copying build/lib.linux-x86_64-2.7/alchemical_analysis/utils/init.py -> build/bdist.linux-x86_64/egg/alchemical_analysis/utils copying build/lib.linux-x86_64-2.7/alchemical_analysis/utils/corruptxvg.py -> build/bdist.linux-x86_64/egg/alchemical_analysis/utils copying build/lib.linux-x86_64-2.7/alchemical_analysis/alchemical_analysis.py -> build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/parser_desmond.py -> build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/parser_gromacs.py -> build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/init.py -> build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/unixlike.py -> build/bdist.linux-x86_64/egg/alchemical_analysis copying build/lib.linux-x86_64-2.7/alchemical_analysis/parser_sire.py -> build/bdist.linux-x86_64/egg/alchemical_analysis byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/parser_amber.py to parser_amber.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/utils/zeroxvg.py to zeroxvg.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/utils/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/utils/corruptxvg.py to corruptxvg.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/alchemical_analysis.py to alchemical_analysis.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/parser_desmond.py to parser_desmond.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/parser_gromacs.py to parser_gromacs.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/unixlike.py to unixlike.pyc byte-compiling build/bdist.linux-x86_64/egg/alchemical_analysis/parser_sire.py to parser_sire.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying alchemical_analysis.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... alchemical_analysis.alchemical_analysis: module MAY be using inspect.getframeinfo creating 'dist/alchemical_analysis-1.0.2dev0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing alchemical_analysis-1.0.2dev0-py2.7.egg removing '/usr/local/lib/python2.7/dist-packages/alchemical_analysis-1.0.2dev0-py2.7.egg' (and everything under it) creating /usr/local/lib/python2.7/dist-packages/alchemical_analysis-1.0.2dev0-py2.7.egg Extracting alchemical_analysis-1.0.2dev0-py2.7.egg to /usr/local/lib/python2.7/dist-packages alchemical-analysis 1.0.2dev0 is already the active version in easy-install.pth Installing alchemical_analysis script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/alchemical_analysis-1.0.2dev0-py2.7.egg Processing dependencies for alchemical-analysis==1.0.2dev0 Searching for pymbar>=3.0.0.dev0 Reading https://pypi.python.org/simple/pymbar/ Best match: pymbar 3.0.3 Downloading https://pypi.python.org/packages/e4/f9/3978e68b2daa7091b123dc2afcdfdf1c4a7c30a4f8ffbbf9752c5ea96a5c/pymbar-3.0.3.tar.gz#md5=07d985d81d0e9c70e9d0dff16364a922 Processing pymbar-3.0.3.tar.gz Writing /tmp/easy_install-tJESeQ/pymbar-3.0.3/setup.cfg Running pymbar-3.0.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-tJESeQ/pymbar-3.0.3/egg-dist-tmp-RlA9M7 author Levi N. Naden and Michael R. Shirts and John D. Chodera author_emaillevi.naden@choderalab.org, michael.shirts@virginia.edu, john.chodera@choderalab.org data_files [('pymbar', ['pymbar/_pymbar.c'])] descriptionPython implementation of the multistate Bennett acceptance ratio (MBAR) method. download_url http://github.com/choderalab/pymbar ext_modules[<setuptools.extension.Extension instance at 0x7fb32aed0ef0>] license MIT long_description Pymbar (https://simtk.org/home/pymbar) is a library that provides tools for optimally combining simulations from multiple thermodynamic states using maximum likelihood methods to compute free energies (normalization constants) and expectation values from all of the samples simultaneously.

                                name                                                      pymbar
                         package_dir        {'pymbar.tests': 'pymbar/tests', 'pymbar': 'pymbar'}
                            packages            ['pymbar', 'pymbar.testsystems', 'pymbar.tests']
                           platforms                            ['Linux', 'Mac OS X', 'Windows']
                            requires                       ['numpy', 'scipy', 'nose', 'numexpr']
                                 url                         http://github.com/choderalab/pymbar
                             version                                                       3.0.3
                            zip_safe                                                       False

pymbar/_pymbar.c:82:20: fatal error: Python.h: No such file or directory

include "Python.h"

                ^

compilation terminated. error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Do you know what is wrong? Thanks a lot for your help!

Best, Raimon

Lnaden commented 7 years ago

Based on the error, I think you need the python development headers (python-dev/python-devel). Depending on how you installed Python will affect how you get the package, but it should be pretty strait forward

raimon-fa commented 7 years ago

sudo apt-get install python-dev solved it, thanks!