Pil Installation Fails Missing:Stdarg.H

PIL Installation Fails missing:stdarg.h

Problem Solved , the steps i took:

Step 1: Uninstalled and Installed Xcode, suggested here:
http://binarylionstudios.com/blog/2011/01/30/error-stdarg.h-no-such-file-or-directory/

to remove Xcode properlly follow this answer:
How to fully remove Xcode 4

sudo /Developer/Library/uninstall-devtools --mode=all

use the install Xcode.app after you restart your mac

Step 2: after xcode was reinstalled, the installation failed

unable to execute gcc-4.2: No such file or directory PIL

to resolve that i followed this post:
http://aravir-rose.blogspot.com/2011/12/installing-python-27s-imaging-library.html

Good luck!

Can't install psycopg2 in virtualenv error: stdarg.h: No such file or directory

It looks like you have a broken build environment. stdarg.h is part of the core gcc headers. On my (Fedora 16 Linux) system stdarg.h is in /usr/lib/gcc/x86_64-redhat-linux/4.6.2/include/stdarg.h and is part of the gcc package.

On Apple platforms I expect it's shipped with XCode. At a guess, you have more than one compiler/toolchain installed, and their include paths are getting muddled. I suggest clean-uninstalling XCode and all its friends, deleting the relevant directories to get rid of stragglers, then reinstalling the lot.

Installing Python Imaging Library (PIL) on Snow Leopard with updated Python 2.6.2

The python.org Python was built with an earlier gcc. Try using gcc-4.0 instead of SL's default of 4.2:

export CC=/usr/bin/gcc-4.0

See similar problem here.

That gets past the stdarg problem. You may then run into later build problems with various dependent libraries.

BTW, gcc-4.0 and gcc-4.2 are both included with Snow Leopard's Xcode 3 so no additional installs are needed.

UPDATED 2011-05: Note, that the newer Xcode 4, released for experimental use with 10.6 and expected to be standard with 10.7, no longer includes PPC support so, if you install Xcode 4, this suggestion will not work. Options include using the newer 64-bit/32-bin Python 2.7.x installers from python.org or installing a newer Python 2.6 and PIL and the various 3rd-party libs using MacPorts, Homebrew, or Fink.

Mac osx lion, virtualenv, pil install - gcc error

Xcode 4.1 on OS X Lion 10.7 no longer includes gcc-4.0 as it did in earlier versions of OS X. When you install a Python package like PIL that includes a C extension module, Python's Distutils will attempt to use the same version of the C compiler that that Python itself was build with. It sounds like the version of Python that was used to create your virtualenv is an older 32-bit-only Python built with gcc-4.0. You can tell for sure by starting the python in your virtualenv. If it says gcc-4.0, you will need to re-create the virtualenv, using a newer base Python, either one of the Apple-supplied Pythons in Lion or installing a newer python using a python.org installer or a brew recipe. Then install Distribute and pip and virtualenv for that Python, create a new virutalenv and then install PIL in it.

Installing PIL on OS X Lion

If you are on Lion, using the newest XCode, then a potential problem for you is that they moved the location of the developer SDKs. Packages that expected them to live in /Developer/ would no longer find them as needed.

Reference this article about specifics:

http://www.agile-workers.com/web/2012/03/qt-qmake-osx_sdk-xcode/

But in summary, what you might need to do is run:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
to point at the new location.

A manual fix might be to just symlink the SDK from /Applications/Xcode.app/Contents/Developer/... => /Developer/..., but I would first try the xcode-select tool.

Update: Some more suggestions based on your new updates

First off, I can't tell from what you posted whether PIL failed to build because of the SDK or not. If it built successfully, and you are using the standard apple python, then chances are the homebrew python path is not in your own python path.

$ python
>>> import sys
>>> sys.path.append("/usr/local/lib/python2.7/site-packages")
>>> from PIL import Image

If that still errors, then I suppose the issue is still related to missing SDK location.
You could symlink the new location of the SDK to the old one with:

mkdir -p -v /Developer/SDKs
ln -s /Applications/Xcode.app/Contents/Developer/MacOSX10.6.sdk /Developer/SDKs/MacOSX10.6.sdk

Or, you can try explicitly setting the the sdk path when you build pil:

brew remove pil
export SDKROOT=/Applications/Xcode.app/Contents/Developer/MacOSX10.6.sdk
brew install pil

gcc-4.2' failed with exit status 1 when installing bcrypt

/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory

I believe stdarg.h. is part of the standard C library, libstdc (or possibly the standard C++ library libstdc++.) This smells to me like libstdc is missing or not located where the compiler thinks it is.

Googling your error message (stdarg.h: No such file or directory) produces a stack of hits on StackOverflow and elsewhere. See here or here for what appear to be exact solutions to your problem.

Remove ppc from compilation flags in python setup scripts

The easiest solution (for a single or a few C files) is to copy the compiler line, edit it, and invoke it manually, then run setup.py again - it should notice that this step was already done.

To make setup.py not use these options anymore, you need to change the Makefile in Python's config directory, and remove the options.

Fatal error when trying to install PyCrypto on OS X El Capitan

Overview:

The manual build you're trying looks like it might be failing because it's referencing the OS X 10.6 SDK, which you likely don't have, and is outdated for the most part. Also, SDKs are now stored in a completely different location than when the 10.6 SDK was in it's prime.

New SDKs location:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

Old SDKs location:

/Developer/SDKs/

Non-existent / outdated SDK:

Since it appears that when trying to build PyCrypto it's referencing the MacOSX10.6.sdk there are several things to consider:

  1. Why does it reference an outdated SDK
  2. Where is the SDK it's referencing set
  3. What should be done to correct the issue

Unless we audit the source code carefully we might not know exactly where the incorrect flags are set, but we can do our best to work with the information we have. From the error we can see that there are several instances where the 10.6 SDK's name pops up:

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/Library

Building from source:

/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.6-intel-2.7/src/MD2.o
src/MD2.c:30:10: fatal error: 'string.h' file not found
#include <string.h>
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

Analyzing this we can see that the PyCrypto's MD2.c file is trying to be built using the flag -isysroot /Developer/SDKs/MacOSX10.6.sdk. It might be worth trying pip instead:

Installing with pip:

...
fatal error: 'string.h' file not found #include <string.h>
...

Same error; we should probably find out if the <string.h> header even exists on the system — Let's make a quick test C application to find out:

Testing the C headers:

$ echo "#include <string.h>
#include <stdio.h>
int main() { printf(\"TEST\n\"); return 0; }" > t.c
$ clang t.c -o t
$ ./t
TEST

It's apparent the header does exist because the test worked fine. This tells us that the problem is more likely related directly to the 10.6 SDK (which doesn't seem to exist on the system).

Symlinking (non-existing) 10.6 SDK to 10.11 SDK:

Since we haven't determined where the SDK is actually getting set we'll go ahead and try to create symlinks so that any reference of the old 10.6 SDK links to the latest SDK (10.11 at this time):

$ cd /Developer/SDKs
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk MacOSX10.6.sdk

We can verify the symlink by issuing the following command:

$ ls -lat
total 8
drwxr-xr-x 3 root wheel 102 Feb 21 15:54 .
lrwxr-xr-x 1 root wheel 99 Feb 21 15:54 MacOSX10.6.sdk -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
drwxr-xr-x 3 root wheel 102 Feb 21 15:52 ..

Now that we've successfully created the symlink let's try installing PyCrypto with pip once more:

$ sudo pip install pycrypto
Collecting pycrypto
Downloading pycrypto-2.6.1.tar.gz (446kB)
100% |████████████████████████████████| 446kB 1.2GB/s
Installing collected packages: pycrypto
Running setup.py install for pycrypto ... done
Successfully installed pycrypto-2.6.1

No errors! It looks like our problem is solved! Well, almost...

We still need to figure out what is responsible for setting the wrong (10.6) SDK during builds. Let's use the xcrun tool to see what the defaults are set at:

$ xcrun --show-sdk-version
10.11

The system default SDK is set to 10.11, so it must be get set incorrectly to 10.6 by Python, PyCrypto, or some other anomaly we might not have considered.

UPDATE:

After doing some recon it was discovered that Python 3 appears to be built with the OS X 10.6 SDK. In addition it's also setting the SDK to 10.6 and setting the (outdated) path in numerous places throughout the Python_Framework. There are so many references I won't bother listing them all, although here's an example:

Python_Framework Folder/Versions/3.5/lib/python3.5/config-3.5m/Makefile:79:CONFIGURE_CFLAGS= -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk

I can only assume the developers were trying to be as backward compatible as possible, however, it's unfortunately breaking forward compatibility in the process.


Notes:

Installing Python packages with pip can make life much easier in a lot of ways (package management, updating, uninstalling, etc.). For example installing PyCrypto should just be a matter of issuing the command:

$ sudo pip install pycrypto

If you have multiple Python's you can use the version number to install for that Python accordingly:

$ sudo pip3.5 install pycrypto

↳ https://pip.pypa.io/en/stable/installing/

Biopython installation on MacOSX El Capitan, gcc error -Qunused-arguments

That's a clang specific option, and, as far as I know, it's unavailable in gcc.

From clang manpage:

   -Qunused-arguments
Don't emit warning for unused driver arguments.

You have [at least] two options to solve that:

  • Remove any ocurrences of Qunused-arguments around the project build files (I don't really recommend this one).
  • Install clang (just run clang on the terminal and follow the installation instructions).

Also [personal opinion ahead], if you don't need gcc for any particular reason, uninstall it, and keep clang on your OSX as it seems to be Apple's wishes :).



Related Topics



Leave a reply



Submit