aspuru-guzik-group / phoenics

Phoenics: Bayesian optimization for efficient experiment planning
Apache License 2.0
89 stars 19 forks source link

Installation fails: numpy/arrayobject.h not found #4

Open larryluer opened 4 years ago

larryluer commented 4 years ago

This happens on both ubuntu 18.04 and Windows 10, using both numpy 1.13.1 and 1.17. In a Python 3.6.8 virtual environment, calling pip install phoenics fails with the following error:

phoenics/BayesianNeuralNetwork/dist evaluations.c:611:10 fatal error: numpy/arrayobject.h: no such file or directory.

On Win 10, the requested header file is in the folder C:\Users\Larry\Documents\vscodeprojs\people.venv36\Lib\site-packages\numpy\core\include\numpy

Why is it not found by the include command? Thanks for help, Larry

FlorianHase commented 4 years ago

Hi Larry, thank you for reaching out and for reporting this issue. It seems as if the paths to your numpy installation are not set as expected. Running

sudo apt-get install python-dev

should set /usr/include/numpy to the correct path. Hope this helps, but please let me know of the problem persists. Cheers

larryluer commented 4 years ago

Dear Florian,

thanks for your fast response; I will try this out on my ubuntu machine at home tonight. How would I solve it on Windows? I could create symbolic links if I knew where the compiler expects the headers to be. Would that work?

Thanks again, best regards

Larry


Von: Florian Häse notifications@github.com Gesendet: Mittwoch, 23. Oktober 2019 00:29:47 An: aspuru-guzik-group/phoenics Cc: Lüer, Larry; Author Betreff: Re: [aspuru-guzik-group/phoenics] Installation fails: numpy/arrayobject.h not found (#4)

Hi Larry, thank you for reaching out and for reporting this issue. It seems as if the paths to your numpy installation are not set as expected. Running

sudo apt-get install python-dev

should set /usr/include/numpy to the correct path. Hope this helps, but please let me know of the problem persists. Cheers

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/aspuru-guzik-group/phoenics/issues/4?email_source=notifications&email_token=ANSCUSZZHQ6H77VIG4LWMNTQP55FXA5CNFSM4JDXEIPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB7NOPI#issuecomment-545183549, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANSCUS6EZFHJFE3O4JTK3TDQP55FXANCNFSM4JDXEIPA.

TBlackmore commented 4 years ago

Hi Florian and Larry,

I've had the same problem today on my Windows10 machine. I eventually got it to install by editing setup.py.

Changed ext_modules = ext_modules to ext_modules = ext_modules, include_dirs=[numpy.get_include()]

after following advice from this stack overflow

I have yet to test if it works beyond installation but I thought I would share my small success.

Cheers, Tim

dking072 commented 4 years ago

I had the problem on mac when I tried pip install. Followed the instructions here and it worked:

http://notesbyanerd.com/2018/11/02/pip-install-cant-find-numpy-header/