pip installlifelines - failure (solved: missing fortran)
See original GitHub issueUsing Anaconda in both Linux Mint abd Mac OS. pip install lifelines results in:
Downloading/unpacking lifelines
Downloading lifelines-0.4.3.tar.gz (628kB): 628kB downloaded
Running setup.py (path:/tmp/pip_build_root/lifelines/setup.py) egg_info for package lifelines
build_src
building extension "lifelines._statistics" sources
f2py options: []
f2py:> build/src.linux-i686-2.7/lifelines/_statisticsmodule.c
Reading fortran codes...
Reading file 'lifelines/_statistics.f90' (format:free)
Post-processing...
Block: _statistics
Block: concordance_index
Post-processing (stage 2)...
Building modules...
Building module "_statistics"...
Creating wrapper for Fortran function "concordance_index"("concordance_index")...
Constructing wrapper function "concordance_index"...
cindex = concordance_index(event_times,predictions,event_observed,[rows])
Wrote C/API module "_statistics" to file "build/src.linux-i686-2.7/lifelines/_statisticsmodule.c"
Fortran 77 wrappers are saved to "build/src.linux-i686-2.7/lifelines/_statistics-f2pywrappers.f"
adding 'build/src.linux-i686-2.7/fortranobject.c' to sources.
adding 'build/src.linux-i686-2.7' to include_dirs.
adding 'build/src.linux-i686-2.7/lifelines/_statistics-f2pywrappers.f' to sources.
build_src: building npy-pkg config files
warning: no files found matching '*' under directory 'styles'
warning: no previously-included files matching '*.py[co]' found under directory '*'
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib/python2.7/dist-packages (from lifelines)
Requirement already satisfied (use --upgrade to upgrade): scipy in /usr/lib/python2.7/dist-packages (from lifelines)
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /usr/lib/pymodules/python2.7 (from lifelines)
Downloading/unpacking pandas>=0.14 (from lifelines)
Downloading pandas-0.14.1.tar.gz (6.7MB): 6.7MB downloaded
Running setup.py (path:/tmp/pip_build_root/pandas/setup.py) egg_info for package pandas
warning: no files found matching 'README.rst'
no previously-included directories found matching 'doc/build'
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.png' found anywhere in distribution
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/lib/python2.7/dist-packages (from matplotlib->lifelines)
Requirement already satisfied (use --upgrade to upgrade): tornado in /usr/lib/python2.7/dist-packages (from matplotlib->lifelines)
Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in /usr/lib/python2.7/dist-packages (from matplotlib->lifelines)
Downloading/unpacking nose (from matplotlib->lifelines)
Downloading nose-1.3.4.tar.gz (277kB): 277kB downloaded
Running setup.py (path:/tmp/pip_build_root/nose/setup.py) egg_info for package nose
no previously-included directories found matching 'doc/.build'
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/lib/python2.7/dist-packages (from pandas>=0.14->lifelines)
Installing collected packages: lifelines, pandas, nose
Running setup.py install for lifelines
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
build_src
building extension "lifelines._statistics" sources
f2py options: []
adding 'build/src.linux-i686-2.7/fortranobject.c' to sources.
adding 'build/src.linux-i686-2.7' to include_dirs.
adding 'build/src.linux-i686-2.7/lifelines/_statistics-f2pywrappers.f' to sources.
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'lifelines._statistics' extension
compiling C sources
C compiler: i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
compile options: '-Ibuild/src.linux-i686-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
i686-linux-gnu-gcc: build/src.linux-i686-2.7/fortranobject.c
In file included from build/src.linux-i686-2.7/fortranobject.c:2:0:
build/src.linux-i686-2.7/fortranobject.h:7:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
In file included from build/src.linux-i686-2.7/fortranobject.c:2:0:
build/src.linux-i686-2.7/fortranobject.h:7:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: Command "i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibuild/src.linux-i686-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c build/src.linux-i686-2.7/fortranobject.c -o build/temp.linux-i686-2.7/build/src.linux-i686-2.7/fortranobject.o" failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lifelines/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xn95nq-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "lifelines._statistics" sources
f2py options: []
adding 'build/src.linux-i686-2.7/fortranobject.c' to sources.
adding 'build/src.linux-i686-2.7' to include_dirs.
adding 'build/src.linux-i686-2.7/lifelines/_statistics-f2pywrappers.f' to sources.
build_src: building npy-pkg config files
running build_py
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/lifelines
copying lifelines/_cox_regression.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/generate_datasets.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/__init__.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/estimation.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/plotting.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/progress_bar.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/datasets.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/statistics.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/utils.py -> build/lib.linux-i686-2.7/lifelines
copying lifelines/_statistics.f90 -> build/lib.linux-i686-2.7/lifelines
copying lifelines/../README.md -> build/lib.linux-i686-2.7/lifelines/..
copying lifelines/../README.txt -> build/lib.linux-i686-2.7/lifelines/..
copying lifelines/../LICENSE -> build/lib.linux-i686-2.7/lifelines/..
copying lifelines/../MANIFEST.in -> build/lib.linux-i686-2.7/lifelines/..
copying lifelines/../Untitled0.ipynb -> build/lib.linux-i686-2.7/lifelines/..
creating build/lib.linux-i686-2.7/datasets
copying lifelines/../datasets/static_test.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/psychiatric_patients.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/gehan.dat -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/dd.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/divorce.dat -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/Divorces Rates.ipynb -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/The Gehan Survival Data.ipynb -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/panel_test.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/canadian_senators.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/lung.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
copying lifelines/../datasets/2002FemResp.csv -> build/lib.linux-i686-2.7/lifelines/../datasets
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'lifelines._statistics' extension
compiling C sources
C compiler: i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/build
creating build/temp.linux-i686-2.7/build/src.linux-i686-2.7
creating build/temp.linux-i686-2.7/build/src.linux-i686-2.7/lifelines
compile options: '-Ibuild/src.linux-i686-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
i686-linux-gnu-gcc: build/src.linux-i686-2.7/fortranobject.c
In file included from build/src.linux-i686-2.7/fortranobject.c:2:0:
build/src.linux-i686-2.7/fortranobject.h:7:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
In file included from build/src.linux-i686-2.7/fortranobject.c:2:0:
build/src.linux-i686-2.7/fortranobject.h:7:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: Command "i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibuild/src.linux-i686-2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c build/src.linux-i686-2.7/fortranobject.c -o build/temp.linux-i686-2.7/build/src.linux-i686-2.7/fortranobject.o" failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lifelines/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xn95nq-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lifelines
Storing debug log for failure in /home/juan/.pip/pip.log
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Still can't install scipy due to missing fortran compiler after ...
Fixed by upgrading pip, even though I just installed my pip/virtualenv the first time ... SSL appropriately and may cause certain SSL connections...
Read more >lifelines Documentation
Traditionally, survival analysis was developed to measure lifespans of individuals. An actuary or health professional.
Read more >Solved: libraries is missing Fortran programming language
I checked the Math Kernel Library during the installation but libraries option is missing in project properties window for intel Fortran ...
Read more >Troubleshooting — Clawpack 5.4.0 documentation
Setting the Fortran compiler to be used by f2py (pip)¶. When trying to install with pip (see Installation instructions (pip)) or python setup.py...
Read more >GFortran - GCC Wiki
gfortran — the GNU Fortran compiler, part of GCC ... packages for gfortran, up-to-date status of the compiler, recently fixed bugs, etc.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Created a fresh VM with Linux Mint “Debian” - 201403 Cinnamon 64-bit, and here are the steps I took from a fresh install to get lifelines installed and working:
@spacecowboy you rock!