X86 64 linux gnu gcc failed

error: command ‘x86_64-linux-gnu-gcc’ when installing mysqlclient

I installed django 1.8.5 in virtualenv and using python 3.4.3 the worked displayed the it works page when using sqlite I wanted to use mysql and I’m trying to install mysqlclient using pip install mysqlclient and I’m getting the following message

---------------------------------------- Failed building wheel for mysqlclient Failed to build mysqlclient Installing collected packages: mysqlclient Running setup.py install for mysqlclient Complete output from command /home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient: running install running build running build_py copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb running build_ext building '_mysql' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.4m -I/home/sasidhar/django/env/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG _mysql.c:40:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Command "/home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient" failed with error code 1 in /tmp/pip-build-5lj39q67/mysqlclient 

I did try installing libraries suggested in error: Setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 and still the problem persists please help me solve this problem
Thanks guys!!

Источник

How to fix the “command ‘x86_64-linux-gnu-gcc’ failed with exit status 1” error

The Linux terminal is the most powerful tool for the operating system since it can be utilized for a wide variety of functions. One of the more common functions is installing a lot of distinct packages. During any installation process of some software, a familiar problem may be encountered with this statement “command ‘x86_64-linux-gnu-gcc’ failed with exit status 1”.

Читайте также:  Astra linux windows домен

This article will shed some light on the reasons that can invoke the above-stated error and also elaborates on the solution to this error.

Resolve the “command ‘x86_64-linux-gnu-gcc’ failed with exit status 1”

There exist various causes which invoke this problem. This section will not only explain the reasoning but also guide you on how to resolve the error in each of these situations.

Reason 1: Missing Development Libraries

The first and most major cause that will cause this error to pop up on your system is that the development library packages are missing from the system. Due to this, many functions from your system will be missing since these packages are extremely important while attempting to make any major changes to the system, such as installing other tools and software.

Solution: Install the System Development Libraries

A simple solution to this issue is to install the missing library packages on the system. Installing these packages will help the system to perform many functions that it was failing to do before, for example, installing other tools and software. To install the development libraries, simply run the command shown below in your terminal:

$ sudo apt install libblas-dev libatlas-base-dev

Once the libraries are installed, you can get out of the error.

Reason 2: Missing Python-dev extension

Another common reason that can invoke this error is that the Python-dev extension is missing from the system. This extension is used for Python C header files. If the task that you are attempting to perform relates to it, then the missing python-dev extension is the reason behind the error.

Solution: Install Python-dev

The simple fix to this problem is to install the required python-dev extension, which will provide all the necessary tools for Python C. To install the extension on your system, simply run the command shown below:

$ sudo apt install python3-dev

Installing this extension to your system should allow you to run your previous commands successfully without the “command ‘x86_64-linux-gnu-gcc’ failed” error.

Читайте также:  Acer как установить linux

Reason 3: Other Missing Libraries

Aside from the two major reasons discussed above, there are some minor packages whose absence can invoke the error. Some of these packages may also be important system development packages, so it is important to have them installed on the system regardless of the situation.

Solution: Install the Missing Libraries

Let’s take a look at some of the most important packages that need to be installed to remove the error mentioned above. Below are some of the commands that are used to install the important libraries on your system:

$ sudo apt-get install libxml2-dev libxslt1-dev

$ sudo apt-get install libssl-dev

$ sudo apt-get install libffi-dev

These are some of the solutions that will help to resolve the problem on your system.

Conclusion

To resolve the “command ‘x86_64-linux-gnu-gcc’ failed with exit status 1” problem, the relevant development tools need to be installed. Mostly those development packages will be installed using the Python-dev package. On the other hand, the system development libraries may need to be installed, such as the “libssl-dev” or “libblas-dev” packages. This article has provided an in-depth guide on how each of these development libraries can be installed onto the system and will help to resolve the error.

TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY

Источник

«error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1» in virtualenv

would add this to the main *system* instance of Python, rather that the one in virtualenv . (see — https://unix.stackexchange.com/a/56392/92486) Can I add python2.7-dev just to the virtualenv version of Python?

Читайте также:  Настройка сети linux iptables

9 Answers 9

Most of the time these are dependency-issues.

Following the stack-trace of the gcc compiler one can see the missing files. Sometimes installing the Python development packages is not enough.

For example: I tried to do pip install requests[security] in my virtualenv foo. This is the result that the pip-installer gave me.

Failed building wheel for cryptography Running setup.py bdist_wheel for cffi Stored in directory: /root/.cache/pip/wheels/99/e7/9a/68b1c8ca6f6f92b5feebd4d9434f50712b84f6a66d1285ea21 Successfully built cffi Failed to build cryptography Installing collected packages: cffi, cryptography, pyOpenSSL, ndg-httpsclient, requests Running setup.py install for cryptography Complete output from command /opt/foo/django-cms-virtualenv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-eZaLAG/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BwgYTp-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/foo/django-cms-virtualenv/include/site/python2.7/cryptography: running install running build running build_py running egg_info writing requirements to src/cryptography.egg-info/requires.txt writing src/cryptography.egg-info/PKG-INFO writing top-level names to src/cryptography.egg-info/top_level.txt writing dependency_links to src/cryptography.egg-info/dependency_links.txt writing entry points to src/cryptography.egg-info/entry_points.txt warning: manifest_maker: standard file '-c' not found reading manifest file 'src/cryptography.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'docs/_build' warning: no previously-included files matching '*' found under directory 'vectors' writing manifest file 'src/cryptography.egg-info/SOURCES.txt' running build_ext building '_Cryptography_cffi_a269d620xd5c405b7' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c -o build/temp.linux-x86_64-2.7/src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.o src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c:217:25: fatal error: openssl/aes.h: Datei oder Verzeichnis nicht gefunden #include ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

The important part is the: #include

The compiler makes pretty clear that it is demanding this file — but it is not there in the filesystem.

Knowing that, the only thing left to do is: install the needed libraries!

  1. Find out which package is needed for your distribution: e.g. for Ubuntu you can go to The Ubuntu Package Search Site and enter the missing file you are looking for. In this case «aes.h«
  2. Install the needed packages using your distributions package management tool: e.g. for Ubuntu: aptitude install libssl-dev
  3. Retry with pip in your virtualenv: pip install requests[security]

Источник

Оцените статью
Adblock
detector