luispedro / milk

MILK: Machine Learning Toolkit
http://www.luispedro.org/software/milk
MIT License
605 stars 146 forks source link

Installation errors using Python 2.7.3 #8

Closed zachwill closed 11 years ago

zachwill commented 11 years ago

Hey @luispedro,

I have Python 2.7.3 installed through homebrew, and I'm seeing the following error when trying to install through pip:

Downloading/unpacking milk
  Running setup.py egg_info for package milk
    build_src
    building extension "milk.supervised._perceptron" sources
    building extension "milk.supervised._lasso" sources
    building extension "milk.unsupervised._kmeans" sources
    building extension "milk.supervised._tree" sources
    building extension "milk.unsupervised._som" sources
    building extension "milk.supervised._svm" sources
    build_src: building npy-pkg config files

Installing collected packages: milk
  Running setup.py install for milk
    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 "milk.supervised._perceptron" sources
    building extension "milk.supervised._lasso" sources
    building extension "milk.unsupervised._kmeans" sources
    building extension "milk.supervised._tree" sources
    building extension "milk.unsupervised._som" sources
    building extension "milk.supervised._svm" sources
    build_src: building npy-pkg config files
    customize UnixCCompiler
    customize UnixCCompiler using build_ext
    customize UnixCCompiler
    customize UnixCCompiler using build_ext
    building 'milk.supervised._lasso' extension
    compiling C++ sources
    C compiler: c++ -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall

    compile options: '-I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
    extra options: '--std=c++0x'
    c++: milk/supervised/_lasso.cpp
    milk/supervised/_lasso.cpp:7:10: fatal error: 'random' file not found
    #include <random>
             ^
    1 error generated.
    milk/supervised/_lasso.cpp:7:10: fatal error: 'random' file not found
    #include <random>
             ^
    1 error generated.
    error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c milk/supervised/_lasso.cpp -o build/temp.macosx-10.8-x86_64-2.7/milk/supervised/_lasso.o --std=c++0x" failed with exit status 1
    Complete output from command /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/cj/5794yqw14v3381qs0br04hf80000gn/T/pip-build/milk/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/cj/5794yqw14v3381qs0br04hf80000gn/T/pip-RpL1TH-record/install-record.txt --single-version-externally-managed:
    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 "milk.supervised._perceptron" sources

building extension "milk.supervised._lasso" sources

building extension "milk.unsupervised._kmeans" sources

building extension "milk.supervised._tree" sources

building extension "milk.unsupervised._som" sources

building extension "milk.supervised._svm" sources

build_src: building npy-pkg config files

running build_py

running build_ext

customize UnixCCompiler

customize UnixCCompiler using build_ext

customize UnixCCompiler

customize UnixCCompiler using build_ext

building 'milk.supervised._lasso' extension

compiling C++ sources

C compiler: c++ -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall

compile options: '-I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'

extra options: '--std=c++0x'

c++: milk/supervised/_lasso.cpp

milk/supervised/_lasso.cpp:7:10: fatal error: 'random' file not found

#include <random>

         ^

1 error generated.

milk/supervised/_lasso.cpp:7:10: fatal error: 'random' file not found

#include <random>

         ^

1 error generated.

error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c milk/supervised/_lasso.cpp -o build/temp.macosx-10.8-x86_64-2.7/milk/supervised/_lasso.o --std=c++0x" failed with exit status 1

When I clone the repo and run python setup.py install, I get this error:

compile options: '-I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-std=c++0x -stdlib=libc++'
c++: milk/supervised/_lasso.cpp
milk/supervised/_lasso.cpp:10:10: fatal error: 'eigen3/Eigen/Dense' file not found
#include <eigen3/Eigen/Dense>
         ^
1 error generated.
milk/supervised/_lasso.cpp:10:10: fatal error: 'eigen3/Eigen/Dense' file not found
#include <eigen3/Eigen/Dense>
         ^
1 error generated.

Thanks for any help!

luispedro commented 11 years ago

Hi,

Thanks. The problem is that you need eigen installed (C++ headers-only library). I would like to improve the error message as a result of your report, but I am not sure how to do it.

timfernando commented 11 years ago

I seem to be running into an identical problem even after installing the package eigen via brew (brew install eigen).

I wonder if it's a path issue in my case?

luispedro commented 11 years ago

Hey guys,

Can you try this version: http://luispedro.org/raw/milk-0.5-git.tar.gz

Let me know if it works. If so, I'll upload it to github.

Tx Luis

luispedro commented 11 years ago

After a discussion on the mailing list, where success was reported with this version, I released it as 0.5.1.

I am closing this. Please open a new ticket if you still have any issues.

jamespjh commented 11 years ago

I still see this issue on Mountain Lion using macports. clone milk, on current master head, python setup.py build,

milk/supervised/_lasso.cpp:10:10: fatal error: 'eigen3/Eigen/Dense' file not found

include "eigen3/Eigen/Dense"

Have tried installing eigen via macports, no change.

jamespjh commented 11 years ago

Turns out that this was due to an https certificate error from wget from bitbucket in get-eigen.sh, so not a problem with milk.

zachwill commented 11 years ago

@jamespjh Find any workaround for it? Thanks for figuring this out!

jamespjh commented 11 years ago

I manually edited get-eigen.sh to add --no-check-certificate: not a great approach, but it got me moving.