I have used the gcc command on the terminal to compile C programs but all of a sudden, after an update to my Mac's OS (to macOS 10.14 Mojave, and XCode 10.0), I started receiving the message:
test.c:8:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.
I already have gcc installed as I can find it in /usr/local/bin and there really is a gcc in there. I tried running the same file on my other iMac and it worked without any issue.
I tried running xcode-select --install and it already was installed, hence it didn't fix the issue I'm having now. I'm guessing that the path is messed up as it doesn't seem like it can find gcc after I started copying and pasting some commands from other resources to solve this issue.
Would like some help on this.
TL;DR
Make sure you have downloaded the latest 'Command Line Tools' package and run this from a terminal (command line):
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
For some information on Catalina, see Can't compile a C program on a Mac after upgrading to Catalina 10.15.
Extracting a semi-coherent answer from rather extensive comments…
Preamble
Very often, xcode-select --install has been the correct solution, but it does not seem to help this time. Have you tried running the main Xcode GUI interface? It may install some extra software for you and clean up. I did that after installing Xcode 10.0, but a week or more ago, long before upgrading to Mojave.
I observe that if your GCC is installed in /usr/local/bin, you probably aren't using the GCC from Xcode; that's normally installed in /usr/bin.
I too have updated to macOS 10.14 Mojave and Xcode 10.0. However, both the system /usr/bin/gcc and system /usr/bin/clang are working for me (Apple LLVM version 10.0.0 (clang-1000.11.45.2) Target: x86_64-apple-darwin18.0.0 for both.) I have a problem with my home-built GCC 8.2.0 not finding headers in /usr/include, which is parallel to your problem with /usr/local/bin/gcc not finding headers either.
I've done a bit of comparison, and my Mojave machine has no /usr/include at all, yet /usr/bin/clang is able to compile OK. A header (_stdio.h, with leading underscore) was in my old /usr/include; it is missing now (hence my problem with GCC 8.2.0). I ran xcode-select --install and it said "xcode-select: note: install requested for command line developer tools" and then ran a GUI installer which showed me a licence which I agreed to, and it downloaded and installed the command line tools — or so it claimed.
I then ran Xcode GUI (command-space, Xcode, return) and it said it needed to install some more software, but still no /usr/include. But I can compile with /usr/bin/clang and /usr/bin/gcc — and the -v option suggests they're using
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Working solution
Then Maxxx noted:
I've found a way. If we are using Xcode 10, you will notice that if you navigate to the /usr in the Finder, you will not see a folder called 'include' any more, which is why the terminal complains of the absence of the header files which is contained inside the 'include' folder. In the Xcode 10.0 Release Notes, it says there is a package:
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
and you should install that package to have the /usr/include folder installed. Then you should be good to go.
When all else fails, read the manual or, in this case, the release notes. I'm not dreadfully surprised to find Apple wanting to turn their backs on their Unix heritage, but I am disappointed. If they're careful, they could drive me away. Thank you for the information.
Having installed the package using the following command at the command line, I have /usr/include again, and my GCC 8.2.0 works once more.
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Downloading Command Line Tools
As Vesal points out in a valuable comment, you need to download the Command Line Tools package for Xcode 10.1 on Mojave 10.14, and you can do so from:
https://developer.apple.com/download/more/
You need to login with an Apple ID to be able to get the download. When you've done the download, install the Command Line Tools package. Then install the headers as described in the section 'Working Solution'.
This worked for me on Mojave 10.14.1. I must have downloaded this before, but I'd forgotten by the time I was answering this question.
Upgrade to Mojave 10.14.4 and Xcode 10.2
On or about 2019-05-17, I updated to Mojave 10.14.4, and the Xcode 10.2 command line tools were also upgraded (or Xcode 10.1 command line tools were upgraded to 10.2). The open command shown above fixed the missing headers. There may still be adventures to come with upgrading the main Xcode to 10.2 and then re-reinstalling the command line tools and the headers package.
Upgrade to Xcode 10.3 (for Mojave 10.14.6)
On 2019-07-22, I got notice via the App Store that the upgrade to Xcode 10.3 is available and that it includes SDKs for iOS 12.4, tvOS 12.4, watchOS 5.3 and macOS Mojave 10.14.6. I installed it one of my 10.14.5 machines, and ran it, and installed extra components as it suggested, and it seems to have left /usr/include intact.
Later the same day, I discovered that macOS Mojave 10.14.6 was available too (System Preferences ⟶ Software Update), along with a Command Line Utilities package IIRC (it was downloaded and installed automatically). Installing the o/s update did, once more, wipe out /usr/include, but the open command at the top of the answer reinstated it again. The date I had on the file for the open command was 2019-07-15.
Upgrade to XCode 11.0 (for Catalina 10.15)
The upgrade to XCode 11.0 ("includes Swift 5.1 and SDKs for iOS 13, tvOS 13, watchOS 6 and macOS Catalina 10.15") was released 2019-09-21. I was notified of 'updates available', and downloaded and installed it onto machines running macOS Mojave 10.14.6 via the App Store app (updates tab) without problems, and without having to futz with /usr/include. Immediately after installation (before having run the application itself), I tried a recompilation and was told:
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.
Running that (sudo xcodebuild -license) allowed me to run the compiler. Since then, I've run the application to install extra components it needs; still no problem. It remains to be seen what happens when I upgrade to Catalina itself — but my macOS Mojave 10.14.6 machines are both OK at the moment (2019-09-24).
After trying every answer I could find here and online, I was still getting errors for some missing headers. When trying to compile pyRFR, I was getting errors about stdexcept not being found, which apparently was not installed in /usr/include with the other headers. However, I found where it was hiding in Mojave and added this to the end of my ~/.bash_profile file:
export CPATH=/Library/Developer/CommandLineTools/usr/include/c++/v1
Having done that, I can now compile pyRFR and other C/C++ programs. According to echo | gcc -E -Wp,-v -, gcc was looking in the old location for these headers (without the /c++/v1), but not the new location, so adding that to CFLAGS fixed it.
When you
updated to Mojave 10.14.6
your /usr/include was deleted again
the package mentioned in #Jonathan-lefflers answer doesn't exist anymore
The file /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg does not exist. and
Xcode complains that command line tools are already installed
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Then, what helped me recover the mentioned package, was deleting the whole CommandLineTools folder
(sudo) rm -rf /Library/Developer/CommandLineTools and reinstall it xcode-select --install.
The problem is that Xcode, especially Xcode 10.x, has not installed everything, so ensure the command line tools are installed, type this in a terminal shell:
xcode-select --install
also start Xcode and ensure all the required installation is installed ( you should get prompted if it is not.)
and since Xcode 10 does not install the full Mac OS SDK, run the installer at
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
as this package is not installed by Xcode 10.
I've found great solution and explanation at this GitHub comment.
The trick:
make SDKROOT=`xcrun --show-sdk-path` MACOSX_DEPLOYMENT_TARGET=
Did the job.
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' might help you. It fixed my problem.
NOTE:
The following is likely highly contextual and time-limited before the switch/general availability of macos Catalina 10.15. New laptop.
I am writing this Oct 1st, 2019.
These specific circumstances are, I believe, what caused build problems for me. They may not apply in most other cases.
Context:
macos 10.14.6 Mojave, Xcode 11.0, right before the launch of macos Catalina 10.15. Newly purchased Macbook Pro.
failure on pip install psycopg2, which is, basically, a Python package getting compiled from source.
I have already carried out a number of the suggested adjustments in the answers given here.
My errors:
pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: xxxx/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bk/_1cwm6dj3h1c0ptrhvr2v7dc0000gs/T/pip-install-z0qca56g/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/bk/_1cwm6dj3h1c0ptrhvr2v7dc0000gs/T/pip-install-z0qca56g/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bk/_1cwm6dj3h1c0ptrhvr2v7dc0000gs/T/pip-record-ef126d8d/install-record.txt --single-version-externally-managed --compile --install-headers xxx/venv/include/site/python3.6/psycopg2
...
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=90615 -DHAVE_LO64=1 -I/Users/jluc/kds2/py2/venv/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I. -I/opt/local/include/postgresql96 -I/opt/local/include/postgresql96/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.14-x86_64-3.6/psycopg/psycopgmodule.o
clang: warning: no such sysroot directory:
'/Applications/Xcode.app/Contents/Developer/Platforms
❌👇the real error👇❌
/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
In file included from psycopg/psycopgmodule.c:27:
In file included from ./psycopg/psycopg.h:34:
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h:25:10: fatal error: 'stdio.h' file not found
❌👆 what I thought was the error 👆❌
#include <stdio.h>
^~~~~~~~~
1 error generated.
It appears you are missing some prerequisite to build the package
What I did so far, without fixing anything:
xcode-select --install
installed xcode
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Still the same error on stdio.h.
which exists in a number of places:
(venv) jluc#bemyerp$ mdfind -name stdio.h
/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/stdio.h
/usr/include/_stdio.h
/usr/include/secure/_stdio.h
/usr/include/stdio.h ✅ 👈 I believe this is the one that's usually missing.
but I have it.
/usr/include/sys/stdio.h
/usr/include/xlocale/_stdio.h
So, let's go to that first directory clang is complaining about and look:
(venv) jluc#gotchas$ cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
(venv) jluc#SDKs$ ls -l
total 0
drwxr-xr-x 8 root wheel 256 Aug 29 23:47 MacOSX.sdk
drwxr-xr-x 4 root wheel 128 Aug 29 23:47 DriverKit19.0.sdk
drwxr-xr-x 6 root wheel 192 Sep 11 04:47 ..
lrwxr-xr-x 1 root wheel 10 Oct 1 13:28 MacOSX10.15.sdk -> MacOSX.sdk 👈
drwxr-xr-x 5 root wheel 160 Oct 1 13:34 .
Hah, we have a symlink for MacOSX10.15.sdk, but none for MacOSX10.14.sdk. Here's my first clang error again:
clang: warning: no such sysroot directory: '/Applications/Xcode.app/.../Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
My guess is Apple jumped the gun on their xcode config and are already thinking they're on Catalina. Since it's a new Mac, the old config for 10.14 is not in place.
THE FIX:
Let's symlink 10.14 the same way as 10.15:
ln -s MacOSX.sdk/ MacOSX10.14.sdk
btw, if I go to that sdk directory, I find:
...
./usr/include/sys/stdio.h
./usr/include/stdio.h
....
OUTCOME:
pip install psycopg2 works.
Note: the actual pip install command made no reference to MacOSX10.14.sdk, that came at a later point, possibly by the Python installation mechanism introspecting the OS version.
Be sure to check Xcode Preferences -> Locations.
The Command Line Tools I had selected was for the previous version of Xcode (8.2.1 instead of 10.1)
Had similar problems as the OP
Issue
cat hello.c
#include <stdlib.h>
int main() { exit(0); }
clang hello.c
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
etc...
Attempted fix
I installed the latest version of XCode, however, release notes indicated the file mentioned in the previous fix, from Jonathan here, was no longer available.
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Details here
https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes , under the New Features section.
Solution that worked for me...
Using details in this comment, https://github.com/SOHU-Co/kafka-node/issues/881#issuecomment-396197724
I found that brew doctor reported I had unused includes in my /usr/local/ folder.
So to fix, I used the command provided by user HowCrazy , to find the unused includes and move them to a temporary folder.
Repeated here...
mkdir /tmp/includes
brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes
After running the scripts, the include file issue was gone.
nb: I commented on this issue here too.
On Big Sur 11.5.2 with XCode 12.5.1 it may help:
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
CMake told me, that /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk didn't exist, and I decided to make a symlink.
P.S. completely removing CommandLineTools directory, running installation, preforming brew upgrade, etc. didn't help before.
I was having this issue and nothing worked. I ran xcode-select --install and also installed /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.
BACKGROUND
Since I was having issues with App Store on a new laptop, I was forced to download the Xcode Beta installer from the Apple website to install Xcode outside App Store. So I only had Xcode Beta installed.
SOLUTION
This, (I think), was making clang to not find the SDKROOT directory /Applications/Xcode.app/...., because there is no Beta in the path, or maybe Xcode Beta simply doesn't install it (I don't know).
To fix the issue, I had to remove Xcode Beta and resolve the App Store issue to install the release version.
tldr;
If you have Xcode Beta, try cleaning up everything and installing the release version before trying out the solutions that are working for other people.
I tried almost all the posted solutions and nothing worked for me. I use Mojave OS (10.14.6) and what finally worked for me (after removing and re-installing Xcode and CLTs and SDK headers):
Install Clang v8 from https://cran.r-project.org/bin/macosx/tools/
Modify the following lines from ~/.R/Makevars file
CC=/usr/local/opt/llvm/bin/clang -fopenmp
CXX=/usr/local/opt/llvm/bin/clang++
with
CC=/usr/local/clang8/bin/clang -fopenmp
CXX=/usr/local/clang8/bin/clang++
Now R packages that rely on C compilers install successfully
As Jonathan Leffler points out above, the macOS_SDK_headers.pkg file is no longer there in Xcode 10.1.
What worked for me was to do brew upgrade and the updates of gcc and/or whatever else homebrew did behind the scenes resolved the path problems.
apue.h dependency was still missing in my /usr/local/include after I managed to fix this problem on Mac OS Catalina following the instructions of this answer
I downloaded the dependency manually from git and placed it in /usr/local/include
I had the same issue with Golang (debugging with Goland) after migration. The only (ridiculous) thing that helped is renaming the following folder:
sudo mv /usr/local/include /usr/local/old_include
Apparently it is related to old files that homebrew installed and now broken.
#JL Peyret is right!
if you macos 10.14.6 Mojave, Xcode 11.0+
then
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
sudo ln -s MacOSX.sdk/ MacOSX10.14.sdk
So I tried to do:
pip install pycrypto --upgrade
which led me to the error:
Cannot find "vcvarsall.bat"
which led me to this solution: How to use MinGW's gcc compiler when installing Python package using Pip?
So I created a distutils.cfg and now pip uses MinGW.
But I still get an error:
error: command 'C:\\Program Files\\Cygwin\\bin\\gcc.exe' failed with exit status 1
Please help.
I have a link to the log from the install: https://dpaste.de/NhV9
I am using Windows 7 64 bit, the latest MinGW to my knowledge, and python 2.7.
If you're using Python 2.7 from python.org, you could try the Microsoft Visual C++ Compiler for Python 2.7:
This package contains the compiler and set of system headers necessary for producing binary wheels for Python 2.7 packages.
I've successfully pip installed pycrypto with MinGW so you may just be missing the Visual C++ redistributable package[1].
That said, you can just use easy_install pycrpyto instead which will download and install the binary version.
[1] http://www.microsoft.com/en-us/download/details.aspx?id=29
It appears that your cygwin setup does not have the gcc compiler configured correctly. I would start by looking there as it is actual compile errors not a missing compiler.
*** Here is a line from your own paste.
C:\Program Files\Python27\include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
This error is purely about a misconfiguration after configure ran which would point to cygwin's gcc not being configured correctly.
The compiler was found and attempted to build the source so the issue is not the vc redistributables not being found.
I am operating on a Mac and using Enthought python I have installed PIP but am having difficulty installing packages.
When I attempt to install Pygame, the package is downloading and begins building but then errors. I realize that Pygame is a relatively complex package but I have similar same problem with simpler packages. Because I thought it may have to do with my installation of Python, I show my env variables at the end. Any help would be appreciated
the trace looks like:
running build_ext
building 'pygame._numericsurfarray' extension
creating build/temp.macosx-10.5-i386-2.7
creating build/temp.macosx-10.5-i386-2.7/src
gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -DNDEBUG -g -O3 -arch i386 -I/NEED_INC_PATH_FIX -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c src/_numericsurfarray.c -o build/temp.macosx-10.5-i386-2.7/src/_numericsurfarray.o
In file included from src/_numericsurfarray.c:23:
src/pygame.h:106:17: error: SDL.h: No such file or directory
In file included from src/_numericsurfarray.c:23:
src/pygame.h:350: error: expected specifier-qualifier-list before ‘SDL_VideoInfo’
src/pygame.h:388: error: expected specifier-qualifier-list before ‘SDL_Surface’
src/_numericsurfarray.c:26:27: error: SDL_byteorder.h: No such file or directory
....
....
...
....
src/_numericsurfarray.c:1097: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
error: command 'gcc' failed with exit status 1
Command /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/9m/qcp8h8ss4ng1v8429jvnkkrc0000gn/T/pip-build/pygame/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9m/qcp8h8ss4ng1v8429jvnkkrc0000gn/T/pip-roxs9O-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/9m/qcp8h8ss4ng1v8429jvnkkrc0000gn/T/pip-build/pygame
Storing complete log in /Users/jc_macpro/.pip/pip.log
my environment variables are:
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/9m/qcp8h8ss4ng1v8429jvnkkrc0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-iwuiuZ/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=FDC661E1-1196-448F-8D69-28AD9D7C496B
USER=jc_macpro
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-pH83z9/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-s4tuBY/Apple_Ubiquity_Message
PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PWD=/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages
LANG=en_US.UTF-8
SHLVL=1
HOME=/Users/jc_macpro
LOGNAME=jc_macpro
SECURITYSESSIONID=186a4
_=/usr/bin/env
OLDPWD=/Library/Frameworks/Python.framework/Versions/Current/bin
I would appreciate any help.
UPDATE: 12/22/12
I have sifted through al of the advice and feedback and appreciate it all very much. All efforts at installing the binaries on Enthought did not work. I did not want o add more complexity with Macports so I decided to blow out my Enthought python and simply work with the official Python 2.7. I am a huge fan of Enthought and it was a great way to provide a stable base from which to work when I started messing around with Python. However, as was pointed out it has some limitations.
With Python 2.7 as my default I reinstalled pip, added basic functionality and was then able to install the binaries necessary for pygame, numpy, matplotlib, and wxPython. So now I functioning and once again dangerous - just now with official Python 2.7!! Thank you all.
You are missing a dependency, SDL.
If you have macports install, use that to install libsdl.
Or better still, download the Pygame binary for Mac; it includes the SDL library in the installer.
The problem is that you need SDL to install PyGame. You may also want to install various SDL add-on packages (SDL_ttf for fonts, etc.) as well.
As Martijn Pieters suggests, Pygame comes with a binary installer for Mac. I have no idea whether it will work with Enthought Python, but I'd try that first.
If it fails, SDL also has a binary installer for Mac. Again, I don't know if it will work for you, but I'd try it next.
If that fails, I'd use Homebrew. Homebrew (unlike MacPorts and Fink) is designed to work well with any Python installation you want to use, and with that Python's pip. (See here and here for details.) So, type brew search sdl to get a list of all of the add-on packages, and then brew install sdl sdl_foo sdl_bar etc. to install them.
For your additional problem, that you can't pip install anything because of permissions errors in '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/`, that's an easy one: You don't have permission to write to that directory. There are two ways to fix it:
Use sudo pip install foo instead of pip install foo.
Use sudo chmod -R a+w /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/ to give yourself write access, so you can pip install foo. (You may need to add a few other directories.)
The second one is very much in the spirit of Homebrew (see the two links above, which go into more detail on how and why to do this), and it works great with python.org packages because many people are using it that way regularly, but I can't guarantee that it's a good idea with Enthought packages, while I can guarantee the first one.
I am trying to install Cython 0.14 on my Windows 7, 32 bit, coupled with Python 3.2. I followed the instructions given at http://wiki.cython.org/InstallingOnWindows, but have run into several deadends. I think the I have followed the instruction for MinGW exactly, except for the part about opening prompt and test if I have installed MinGW correctly (How do I test that?).
I first ran into some errors when I tried installing Cython by typing
python setup.py install
in cygwin, but I resolved those. However, my python 3.2 still didn't know of the existence of Cython, so I tracked to problem down to cython being installed under c:\cygwin\lib\ while python is installed under c:\python32. So I tried various methods of moving cython to python folder, but since I didn't know where exactly everything goes, those attempts did not come to fruition.
In the interim, I tried to look for different, faster interpreters of python, and installed pypy. I also reinstalled python 3.2 to clear out the mess I made by trying to install cython in the python directory.
Then later I tried to install cython again using the command prompt, with the same script, but found that the default version of python has changed to 2.6, which probably sneaked in with the failed cython installations. But finding that python 2.6 can't compile the setup.py file, I just did
c:\python32\python setup.py install
in the cython directory. This worked until it gave me an error
TypeError: NoneType() is Unordered: if self.gcc_version <= "2.91.57":
in the distutils.cygwinccompiler module in python32. So I changed that to
if (not self.gcc_version == None) and self.gcc_version <= "2.91.57":
When I tried installing again under the command prompt, I get this error:
running build
running build_py
running build_ext
Access is denied.
skipping 'C:\cython-0.14.1\Cython\Plex\Scanners.c' Cython extension (up-to-date)
building 'Cython.Plex.Scanners' extension
C:\cygwin\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pyth
on32\PC -c C:\cython-0.14.1\Cython\Plex\Scanners.c -o c:\cython-0.14.1\cython\pl
ex\scanners.o
error: command 'gcc' failed: Permission denied
I tried the same thing with cygwin and I get the same error. I have restarted my computer and tried again, still same error.
Any and all help would be appreciated, since I spent an entire day on this to no avail.
The "Permission denied" is still a good way to look. It can happen because:
the gcc command is not executable (weird, but are you able to type "gcc --version" and get the output ?)
the destination path "c:\cython-0.14.1\cython\plex\" is not available or not writable. If you have install it with administration right and use with user right, maybe it's the case. Try to give access to everyone here. (disclamer: i'm not a windows guy ^^)
See Get "Access is denied" when trying to compile with g++ from command line. Cygwin. This fully addresses your question. The issue is apparently symlinks (as i learnt today much to my discomfiture).