ive had this issue with PIL and reportlab so far. the issue is that the install fails with
error: command 'gcc-4.2' failed with exit status 1
i've found a fix, in this document paikialog
question is,
why does the
ARCHFLAGS="-arch i386 -arch x86_64"
fix the issue?
whats it doing?
and how can i force that globally so i dont have to use it every time i try to add a module that needs compiling?
The explanation is here. You could avoid the problem by installing Xcode 3 instead of Xcode 4. Or, better, you can avoid the problem by installing another Python instance that does not include the PPC arch; a good choice is the current Python 2.7.2 64-/32-bit installer from python.org.
I suggest using MacPorts which allows the simple installation of almost all available python libraries.
Related
I am trying to install PyVlFeat and the installation is failing with exactly this issue mentioned here.
pyvlfeat error during installation: /usr/bin/ld: cannot find -lboost_python-mt-py26
As per the answer mentioned there, I need to change the reference of "-lboost_python-mt-py26" to the correct version of Boost Python I have on my system.
I am on ubuntu 14.04 and I tried to detect the version of my boost python by using this command "ls /usr/lib/libboost_python*"
I don't seem to have any libraries with a similar name there. However, I have installed Boost Python using this command "sudo apt-get install libboost-all-dev" as mentioned here.
https://stackoverflow.com/questions/25891667/boost-undefined-reference-ubuntu-14-04-boost-1-54
Since Boost Python is already there, how should I use it correctly to compile PyVlFeat.
The -mt suffix had been removed from Boost Libraries. The installed Boost libraries are multi-threading safe.
Changing the reference to "-lboost_python-py27" (Removing -mt suffix and using proper version of python will solve the problem.
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.
When installing packages in Python using pip, I came across the following error:
unable to execute gcc-4.2: No such file or directory
Clearly, pip is trying to use gcc-4.2 which is not in any of the binary directories, namely /usr/bin. After looking around this site and others, I have found that many others are suffering from the same issue. However, gcc is updated to version 4.2 in OS X Lion and this is not a version problem, rather, gcc is just called gcc, not gcc-4.2, under /usr/bin, and is symlinked to llvm-gcc. After adding gcc-4.2 in /usr/bin as a symlink to gcc, pip was able to install everything successfully. Why is it then, that pip is looking for gcc-4.2 and not gcc? Is this the fault of pip, OS X Lion, or the packages within pip that are trying to install themselves with gcc-4.2?
Finally, is my symlink hack the right thing to do in this situation, or should I have fixed this some other way?
Your simlink hack is the right solution for now. Ultimately the people who support pip for the platform need to stop using explicit versions of the compiler that way. It was a bad idea to begin with and will only be worse as compilers on the platform change.
Contrary to Milad's answer there are other solutions to determining version in the host compiler and your solution will work until the people who support pip on the platform fix their code.
You symlink hack is the right solution for you. pip is just trying to ensure that it is being installed using the right version of GCC. Since your computer is equipped with that version, it is safe for you to point it to your available gcc as the one it is looking for. But if, say, you had gcc-4.1 your installation might have gone places it shouldn't have.
I am attempting to set up my Django virtualenv production environment on a Linux shared host server. Installing python packages using pip goes fine until I try to install Mysql-Python, which crashes. Does anyone know why this is failing? Looking through the error log, I think it's an architecture incompatibility between the package and my python installation because of these lines:
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: warning: i386 architecture of input file build/temp.linux-x86_64-2.4/_mysql.o' is > incompatible with i386:x86-64 output build/temp.linux-x86_64-2.4/_mysql.o: In function _mysql_field_to_python':
I was told the server is 64-bit and is running Python 2.4, although I'm not sure how to double-check the former. Ive been googling this issue for several hours but I've only found references to install/import errors on macs. I'm thinking perhaps I need to compile a different version of MySQLdb instead of just doing pip install -E myvirtualenv MySQL-python but I'm unsure. Any help is greatly appreciated.
If you can't get the same architecture through pip or your package manager, you will probably need to either recompile Python (which you might consider anyway -- Python 2.4 is old), or MySQLdb.
Unfortunately, a lot of Python libraries are not cross-compatible between i386 and x86_64 -- I've actually had exactly the same issue with HGSubversion (the actual issue was with subvertpy, but I needed that for hgsubversion) and cx_Oracle. My solution was to downgrade Python to 2.6 for i386. Stunk.
i am trying to install pygtk on my mac which then asked me to install pygobject which then asked me to get gobject-introspection . the problem i have in this installation is while configuring it shows this error :
checking for FFI... no
checking for ffi.h... configure: error: ffi.h not found
please do help me with this as i need to get gtk .
/usr/include/ffi->location of ffi.h
thanks in advance
Try this:
export FFI_CFLAGS=/usr/include
export FFI_LIBS=/usr/lib
then
./configure
I hope this solves your problem.
I initially found this compile failure while assembling GLib (all versions I tried that were more recent than 2.28.7), but I again encountered it with gobject; and it appears related to several other packages' build failures:
http://lists.gnu.org/archive/html/guile-gtk-general/2006-10/msg00010.html
Weird error when installing GLIB
http://lists.freebsd.org/pipermail/freebsd-gnome/2011-August/026346.html
I tried following the advice provided in all of these threads (as the solutions discussed are largely the same) with no success.
The Final Solution: a complete recompile and install of GCC (4.7.2)
Why did compiling GCC (4.7.2) solve the issue?
I found this post in the Debian Bug Archive: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523869
While reading, I noted that my system was using an affected version of GCC to compile my various sources (from an FC9 installation on a relic laptop).
I chose 4.7.2 as my goal because it was, at the time of this writing, the most current build in the stable tree. I'm relatively sure that a simple package install of a recent GCC on your system will yield the same results (so long as you get 4.3.5-4 or later), but I haven't tested this as there are understandably no such packages for an FC9 install. The package route has many potential positive aspects beyond being easy, please read below..
Important Note: If you are trying to compile GCC, you'll probably need a working (and current) glibc enviroment... Please read up on this complication BEFORE you start the manual process: http://cygwin.com/ml/libc-alpha/2012-02/msg00646.html
The workaround is to find a Glibc version that predates the commit noted in the article above (i went with 2.14), compile GCC 4.5 with that installed (i chose 4.5.3 due to release proximity with glibc 2.14), and then start the process again with current Glibc and GCC... best of luck!
GCC: http://ftp.gnu.org/gnu/gcc/
Glibc: http://ftp.gnu.org/gnu/glibc/
Binutils: http://ftp.gnu.org/gnu/binutils/
ffi.h is provided by the package libffi-dev, which is actually from the gcc source package. and most probably it's available for linux.