Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing issue while executing make apps in my Mac OSX 10.10.2 version #251

Closed
sarojrout opened this Issue Oct 29, 2015 · 21 comments

Comments

Projects
None yet
@sarojrout
Copy link

sarojrout commented Oct 29, 2015

Error: must have python development packages for 2.6 or 2.7. Could not find Python.h. Please install python2.6-devel or python2.7-devel". Stop.

@sarojrout

This comment has been minimized.

Copy link
Author

sarojrout commented Oct 29, 2015

The python version in my mac is 2.7.10

@sarojrout

This comment has been minimized.

Copy link
Author

sarojrout commented Oct 30, 2015

The issue got resolved after upgrading to El Capitan osx and running the below command.
export LDFLAGS=-L/usr/local/opt/openssl/lib && export CPPFLAGS=-I/usr/local/opt/openssl/include
The reason was: /usr/include was not getting created and python2.6/2.7 was not getting installed inside /include

@sarojrout sarojrout closed this Oct 30, 2015

@scheung38

This comment has been minimized.

Copy link

scheung38 commented Jan 29, 2016

Also in El Capitan:

In my home directory:

$ brew install hadoop
$ brew install openssl
$ export LDFLAGS=-L/usr/local/opt/openssl/lib && export CPPFLAGS=-I/usr/local/opt/openssl/include
at cd into hue directory

and cd into hue:

$ make apps
/Users/seb/hue/Makefile.vars:42: *** “Error: must have python development packages for 2.6 or 2.7. Could not find Python.h. Please install python2.6-devel or python2.7-devel”. Stop.

Why is that thanks

@romainr

This comment has been minimized.

Copy link
Member

romainr commented Jan 29, 2016

Do you have a python like /usr/include/python2.7/Python.h or /usr/include/python2.6/Python.h installed?

@spaztic1215

This comment has been minimized.

Copy link
Contributor

spaztic1215 commented Jan 29, 2016

Sometimes the Python dev packages are instead installed under /usr/local/Cellar/python/ and typically you can just symlink the /usr/include/python2.7 link to where it's actually installed. But I think that El Capitan has actually disabled the entire /usr/include tree so you might want to try just skipping the check by setting export SKIP_PYTHONDEV_CHECK=1 before you run make apps.

@scheung38

This comment has been minimized.

Copy link

scheung38 commented Jan 29, 2016

My default Python is installed via anaconda:

$ which python
/Users/seb/anaconda/bin/python

$ python
Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

Hi spaztic1215 how to symlink, from which source file to which target file?

ok after

$ ssh localhost 

then added the line

export SKIP_PYTHONDEV_CHECK=1

and then cd into hue directory and

$ make apps

and now it seems to build, but

building 'Crypto.PublicKey._fastmath' extension
gcc -fno-strict-aliasing -I/Users/seb/anaconda/include -arch x86_64 -fwrapv -Wall -Wstrict-prototypes -I/usr/local/opt/openssl/include -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/Users/seb/anaconda/include/python2.7 -c src/_fastmath.c -o build/temp.macosx-10.5-x86_64-2.7/src/_fastmath.o
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
          ^
1 error generated.
error: command 'gcc' failed with exit status 1
make[2]: *** [/Users/seb/hue/desktop/core/build/pycrypto-2.6.1/egg.stamp] Error 1
make[1]: *** [.recursive-env-install/core] Error 2
make: *** [desktop] Error 2

even though I already had

brew install gmp

???

The confusion for me is do you install brew install hadoop, etc in Mac OSX or after ssh localhost?

@spaztic1215

This comment has been minimized.

Copy link
Contributor

spaztic1215 commented Jan 29, 2016

All of the brew commands, as well as the make apps command, should be done within the terminal in Mac OSX. Is there a particular reason why you aren't using the Python 2.7 that is shipped with El Capitan? Assuming that gmp installed correctly, then the extra step export the openssl flags:

export LDFLAGS=-L/usr/local/opt/openssl/lib && export CPPFLAGS=-I/usr/local/opt/openssl/include

should allow the build to find those missing extensions. Does that path /usr/local/opt/openssl exist on your machine?

@scheung38

This comment has been minimized.

Copy link

scheung38 commented Jan 29, 2016

Yes already did these two commands:

$ export LDFLAGS=-L/usr/local/opt/openssl/lib
$ export CPPFLAGS=-I/usr/local/opt/openssl/include

But still the same gmp not found, is it because I am using this anaconda python distribution? Since I noticed this src/_fastmath.c line 36 gmp.h not found:

building 'Crypto.PublicKey._fastmath' extension
gcc -fno-strict-aliasing -I/Users/seb/anaconda/include -arch x86_64 -fwrapv -Wall -Wstrict-prototypes -I/usr/local/opt/openssl/include -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/Users/seb/anaconda/include/python2.7 -c src/_fastmath.c -o build/temp.macosx-10.5-x86_64-2.7/src/_fastmath.o
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
-> include gmp.h

If thats the case not sure how to switch anaconda python back to default Apple Python, if that's the cause?

Yes path

/usr/local/opt/openssl/

exists

@enricoberti

This comment has been minimized.

Copy link
Contributor

enricoberti commented Jan 29, 2016

You did brew install gmp right?

@scheung38

This comment has been minimized.

Copy link

scheung38 commented Jan 29, 2016

@enricoberti :

$ brew install gmp
Warning: gmp-6.1.0 already installed

so looks correct to me

or do I need to define?

export HADOOP_PREFIX={your hadoop distribution directory}

seems like HADOOP_PREFIX is redundant?

@Detry322

This comment has been minimized.

Copy link

Detry322 commented Apr 27, 2016

was this solved? having this issue right now :/

@PedroMDuarte

This comment has been minimized.

Copy link

PedroMDuarte commented May 19, 2016

I was having a similar issue when running make apps. The first time I run it, my PATH environment variable was set up so anaconda was being used. I went ahead and changed my PATH so that it used the system's python located at /usr/bin/python. That was not enough to solve the problem, as it seems that the hue path was polluted with some content related to the original failure. I tried running make clean, but that did not work either. I deleted the repo and cloned it again and that solved the problem!

After cloning the repo, here are the commands I used to get make apps to work:

[09:20]  @im-MBPR13-18 : my-sandbox$ which brew 
/usr/local/bin/brew
[09:20]  @im-MBPR13-18 : my-sandbox$ echo $PATH
/Users/pedroduarte/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
[09:20]  @im-MBPR13-18 : my-sandbox$ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
[09:21]  @im-MBPR13-18 : my-sandbox$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
[09:21]  @im-MBPR13-18 : my-sandbox$ which brew
/usr/local/bin/brew
[09:21]  @im-MBPR13-18 : my-sandbox$ brew install maven
Warning: maven-3.3.9 already installed
[09:21]  @im-MBPR13-18 : my-sandbox$ brew install mysql
Warning: mysql-5.7.12 already installed
[09:21]  @im-MBPR13-18 : my-sandbox$ brew install gmp
Warning: gmp-6.1.0 already installed
[09:21]  @im-MBPR13-18 : my-sandbox$ export LDFLAGS=-L/usr/local/opt/openssl/lib && export CPPFLAGS=-I/usr/local/opt/openssl/include
[09:21]  @im-MBPR13-18 : my-sandbox$ echo $LDFLAGS
-L/usr/local/opt/openssl/lib
[09:21]  @im-MBPR13-18 : my-sandbox$ echo $CPPFLAGS
-I/usr/local/opt/openssl/include
[09:21]  @im-MBPR13-18 : my-sandbox$ which python
/usr/bin/python
[09:21]  @im-MBPR13-18 : my-sandbox$ cd hue
[09:22]  @im-MBPR13-18 : hue$ make apps
--- Creating virtual environment at /Users/pedroduarte/my-sandbox/hue/build/env
python2.7 /Users/pedroduarte/my-sandbox/hue/tools/virtual-bootstrap/virtual-bootstrap.py \
        -qq --system-site-packages /Users/pedroduarte/my-sandbox/hue/build/env
--- /Users/pedroduarte/my-sandbox/hue/build/env ready
cd /Users/pedroduarte/my-sandbox/hue/maven && mvn install 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Hue Maven Parent POM 3.10.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
@riching

This comment has been minimized.

Copy link

riching commented Sep 8, 2016

ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl

@romainr

This comment has been minimized.

@darshanmodh

This comment has been minimized.

Copy link

darshanmodh commented Dec 13, 2016

if you installed/updated your xcode recently, use following command to create necessary files in /usr

xcode-select --install

@richtrf

This comment has been minimized.

Copy link

richtrf commented Feb 1, 2017

Is this solved? I'm still seeing the following error by doing "make apps"

I already do brew install gmp but still see similar error as @scheung38 's one

src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
          ^
324 warnings and 1 error generated.
error: command 'clang' failed with exit status 1
make[2]: *** [/Users/ychang/Documents/Projects-Python/hue/desktop/core/build/pycrypto-2.6.1/egg.stamp] Error 1
make[1]: *** [.recursive-env-install/core] Error 2
make: *** [desktop] Error 2
@romainr

This comment has been minimized.

Copy link
Member

romainr commented Feb 1, 2017

You are missing the gmp package, etc https://github.com/cloudera/hue#development-prerequisites

@richtrf

This comment has been minimized.

Copy link

richtrf commented Feb 1, 2017

@romainr I did use brew install gmp to have the package. Any other suggestion to install it? Thanks!

My gmp version:
gmp-6.1.2 already installed

@sayan1886

This comment has been minimized.

Copy link

sayan1886 commented Feb 3, 2017

steps to fix

  1. symlink gmp.h to /usr/inlude/
  2. add LDFLGS="-L/usr/local/opt/openssl/lib -L/path/to/gmp/lib"

Hope this will work.

@jonathanchc

This comment has been minimized.

Copy link

jonathanchc commented Apr 6, 2017

I was experimenting the same issue on MAC Sierra

You Should try with this commands.

gem install ffi

make clean

make app

Good luck!!

@FrommyMind

This comment has been minimized.

Copy link

FrommyMind commented Nov 2, 2018

building '_cffi_backend' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/opt/openssl/include -I/usr/include/ffi -I/usr/include/libffi -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.6-intel-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: 'ffi.h' file not found
#include <ffi.h>

Then I do
https://stackoverflow.com/questions/22875270/error-installing-bcrypt-with-pip-on-os-x-cant-find-ffi-h-libffi-is-installed/25854749#25854749
brew install pkg-config libffi

make apps
got below error

No local packages or download links found for cffi>=1.4.1

Then I copy the folder cffi-1.11.5.dist-info to PATH/hue/build/env/lib/python2.7/site-packages/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.