halotools icon indicating copy to clipboard operation
halotools copied to clipboard

pip install failure on MacOS High Sierra 10.13

Open duncandc opened this issue 8 years ago • 16 comments

I tried to install Halotools with pip install halotools and the install fails with the following error:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/02/_3trvknx2199yf629jn2hm3r0000gn/T/pip-build-syx0iqkf/halotools/

duncandc avatar Oct 02 '17 19:10 duncandc

After trying to install this using setup.py, I get the following error:

unable to execute 'x86_64-apple-darwin13.4.0-clang++': No such file or directory error: command 'x86_64-apple-darwin13.4.0-clang++' failed with exit status 1

There is some issue with clang on OS 10.13 that I cannot figure out. Setting CC=clang or gcc does not solve the problem for me.

This seems to be similar to issue #447 that @manodeep was having last year.

duncandc avatar Oct 02 '17 22:10 duncandc

I've never encountered that before, Duncan. Tagging @eteq and @bsipocz in case they've seen this issue come up before in other affiliated packages that use cython.

aphearin avatar Oct 02 '17 23:10 aphearin

@aphearin - Sorry, I haven't seen this before as I don't have any c++ dependencies for my projects. Hopefully @eteq or stackoverflow will know a solution.

bsipocz avatar Oct 02 '17 23:10 bsipocz

ok, one more thing that is interesting. For some reason, the setup script is looking for a much older version of the compiler. Here is the version of clang I have. (gcc and g++ all link to the same thing)

clang --version
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

This is different than x86_64-apple-darwin13.4.0-clang++ that comes up in the error.

duncandc avatar Oct 02 '17 23:10 duncandc

Okay, there is a VERY simple solution. Setting the CXX variable is key. export CXX=clang solves the problem. I think the astropy setup utils could be slightly more informative when the c++ or the c compilers are not set.

duncandc avatar Oct 03 '17 00:10 duncandc

The default compiler is the compiler that was originally used to compile python. Which tends to be fairly old. @duncandc glad you got the compilation sorted.

manodeep avatar Oct 03 '17 00:10 manodeep

ok, all is good. I think we should consider adding a note about setting CXX=clang to the installation troubleshooting page. @aphearin thoughts? https://halotools.readthedocs.io/en/latest/installation_troubleshooting.html#installation-troubleshooting

duncandc avatar Oct 03 '17 14:10 duncandc

Sounds good, Duncan. Since you encountered the issue then you're probably the best person to write the docs modification in a way that will be clearest to other people who encounter it.

aphearin avatar Oct 03 '17 14:10 aphearin

I encountered the same problem, but after the "export CXX=clang", the error still exits.

Zellar209 avatar Dec 08 '18 20:12 Zellar209

@Zellar209 - can you give some more details of your system information? For example, I am able to reproduce a cython build problem in python 3.6, but not in 2.7.

aphearin avatar Dec 11 '18 16:12 aphearin

"export CXX=clang" is not working for me..

youmin817 avatar Sep 24 '19 01:09 youmin817

@youmin817 - what version of python? Can you give some system information?

aphearin avatar Sep 24 '19 01:09 aphearin

@youmin817 - what version of python? Can you give some system information?

I have python3.7

youmin817 avatar Sep 24 '19 02:09 youmin817

@youmin817 I have the similar issue and I fixed it by running export CC=/usr/bin/clang export CXX=/usr/bin/clang++

JiaminShi avatar Nov 10 '19 05:11 JiaminShi

@JamieShi Do you get the performance boost with threads when using /usr/bin/clang to compile?

manodeep avatar Nov 10 '19 08:11 manodeep

@JiaminShi Thank you. I had similar problem. I used export CC=/usr/bin/clang export CXX=/usr/bin/clang++ and my problem solved.

vishalbarad avatar Dec 02 '20 07:12 vishalbarad