Can't install discount with pip: error: command 'cc' failed with exit status 1

10,248

Try:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install discount

This seems to be an issue with LLVM in XCode 5.1 as mentioned here: Can't install mysql gem on OS X

Share:
10,248
MichaelKaeser
Author by

MichaelKaeser

Updated on June 12, 2022

Comments

  • MichaelKaeser
    MichaelKaeser almost 2 years

    I am running into many problems when trying to install the discount package on osx 10.9 Mavericks. I'm working with the django framework.

    My steps are (while having a virtualenv activated):

    pip install discount
    

    Then I get:

    .
    .
    .
    
    1 error generated.
    
    error: command 'cc' failed with exit status 1
    
    ----------------------------------------
    Cleaning up...
    Command /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/bin/python -c "import setuptools;__file__='/Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/build/discount/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/4b/smwv2y_s32z044brp6t__ssh0000gp/T/pip-65i7x3-record/install-record.txt --single-version-externally-managed --install-headers /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/include/site/python2.7 failed with error code 1 in /Users/KaeserMic/Sites/2013/Duotones/naturkostbar/env/build/discount
    Storing complete log in /Users/KaeserMic/.pip/pip.log
    

    Here is the complete log:

    https://gist.github.com/MichaelKaeser/7302829

    Things I did:

    • updating python
    • updating pip
    • updating virtualenv
    • updating homebrew

    Any ideas how to solve this issue? Thanks in advance.

  • MichaelKaeser
    MichaelKaeser over 10 years
    Yes it ouutputs both an error: clang: error: no input files. But I do have Xcode installed, version 5.0.1
  • Admin
    Admin over 10 years
    That error is normal because there's no input file. cc is installed on your mac by default I guess. Anyway, just google for Xcode Command Line Tools 10.9 and install them.
  • Admin
    Admin over 10 years
    Try this: ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.‌​platform/Developer/S‌​DKs/MacOSX10.9.sdk/S‌​ystem/Library/Framew‌​orks/Tk.framework/Ve‌​rsions/8.5/Headers/X‌​11 /usr/local/include/X11
  • MichaelKaeser
    MichaelKaeser over 10 years
    I created the link to X11 like you explained, but it doesn't change anything. What's the link supposed to achieve?
  • Admin
    Admin over 10 years
    It's creating a symbolic link for X11, some people worked with them. Anyway, these are the main problems. The last thing I could think of is to run xcode-select --install in the terminal, in case you already installed the tools, it shouldn't download. Give it a shot anyway. I had the same issue, and it worked after installing the xcode command line tools.
  • MichaelKaeser
    MichaelKaeser over 10 years
    Tried it, but an alert window pops up with: Can't install the software because it is not currently available from the Software Update server. Already did that 12 hours ago...
  • Mart Coul
    Mart Coul over 10 years
    I add the same error on Mavericks. Although Xcode was installed, I still needed to run the xcode-select command as explained in the answer to make it work. xcode-select --install
  • Hartley Brody
    Hartley Brody about 10 years
    Note to any copy/paster's that the pip install command for the OP's package is on the end of that command. You might have to edit if you got this error while installing something else.
  • andilabs
    andilabs about 10 years
    It helped me installing jellyfish on Mac OS X 10.9. THANKS!