10

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
  • 162
  • 1
  • 2
  • 12
  • `cc` is a C compiler. Do you have a C compiler installed? – darthbith Nov 04 '13 at 14:22
  • (edited complete log link, btw) Does this compiler not come with the xcode command line tools? If not, what should I install? – MichaelKaeser Nov 04 '13 at 14:27
  • Hmm, based on your log it seems like it is able to find the C compiler. So I'm not sure anymore! The error is coming because `unterminated conditional directive`... You appear to also be missing some dependencies... `markdown requires either strcasecmp() or stricmp()`. Try googling those things? Sorry I can't help further :-) Those are on lines 255 and 102 of your log file, btw. – darthbith Nov 04 '13 at 14:29
  • I updated recently to Mavericks, are there other things I may should install/update to work with python and pip..? – MichaelKaeser Nov 04 '13 at 14:36
  • Post the full error message, I've had similar, and I have a feeling there is an error before the `cc` error that you ended up not sharing :) – Parker Mar 18 '14 at 03:59
  • @MichaelKaeser if one of the answers worked for you, be sure to mark it so others with the same problem can figure out how to fix it :) – Parker Oct 21 '14 at 02:28

2 Answers2

21

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

Community
  • 1
  • 1
Parker
  • 8,539
  • 10
  • 69
  • 98
  • 1
    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. – Hartley Brody Mar 21 '14 at 21:44
  • It helped me installing jellyfish on Mac OS X 10.9. THANKS! – andilabs Mar 24 '14 at 10:58
0

If you enter gcc or cc in the terminal, will it output an error? Do you have Xcode installed?

xcode-select....

If so, Mac Os Mavericks should alert you to install Xcode Command Line Tools.

  • Yes it ouutputs both an error: `clang: error: no input files`. But I do have Xcode installed, version 5.0.1 – MichaelKaeser Nov 04 '13 at 16:28
  • 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. –  Nov 04 '13 at 16:30
  • Try this: `ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11` –  Nov 04 '13 at 17:45
  • I created the link to X11 like you explained, but it doesn't change anything. What's the link supposed to achieve? – MichaelKaeser Nov 04 '13 at 20:14
  • 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. –  Nov 04 '13 at 20:41
  • 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... – MichaelKaeser Nov 04 '13 at 21:50
  • 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` – Mart Coul Jan 29 '14 at 20:31