Tuesday, 30 September 2014

error: command 'gcc' failed with exit status 1 or status 4

You are getting this error because of gcc library which is not present in your system. If you get above error in ubuntu or windows then follow below step.

For Ubuntu or linux system, Install all library

sudo apt-get install libxml2
sudo apt-get install libxslt1.1
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python-libxml2
sudo apt-get install python-libxslt1
sudo apt-get install python-dev
sudo apt-get install python-setuptools

easy_install lxml

It has worked for my ubuntu 12.10 100% sure.

If you have windows system then try to download below msi file and install it. It will install gcc library and now you can reosolve this error.

It tries to fix all the problems with compiling Python distutils extensions with GCC (the good ol' MSVCR71.DLL problem, if you know what I am speaking of). See below for details, but it really should Just Works(TM). Using GCC, it is possible to produce extensions (.pyd) which are fully compatible with the official python.org distribution (so, they can be mix'n'matched with extensions compiled with Visual Studio).

Download the package here: Gcc-mingw-4.3.3 exe

It's GPL licensed (do I really need to say that?)

It contains:
    GCC 4.3.3-tdm-1 (http://www.tdragon.net/recentgcc/)
    binutils 2.19.1
    mingw32-make 3.81-2
    mingwrt 3.16
    w32api 3.13

What does the installer do?

    Copies the binary files to run GCC.
    Install the gccmrt script (see below).
    Optionally modify the environment PATH.
    Optionally configures an existing Python installation to use GCC for distutils.

If your Problem is not resolving with above solution then try to install (http://sourceforge.net/projects/mingw/files/Installer/), but i am not sure this solution will work for you or not.

Thanks guys for your support.

No comments:

Post a Comment