5

use ubuntu virtualenv. I try to install reportlab

the command is

pip install reportlab

in this directory

(company2)stefano@stefano-X550EP:~/htdocs/company2$

the error is

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

actually the pip list is:

argparse (1.2.1)
Django (1.7.7)
html5lib (0.999)
pip (1.5.4)
pisa (3.0.33)
PyPDF2 (1.24)
setuptools (2.2)
wsgiref (0.1.2)
xhtml2pdf (0.0.6)

I need reportlab to use xhtml2pdf because now the django project gives me this error:

No module named reportlab.lib.colors
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Stefano Ruzza
  • 93
  • 1
  • 2
  • 9

5 Answers5

12

without your full error log, it is impossible to tell. But I bet you are just missing python-dev.

try installing it:

$ sudo apt-get install python-dev

then pip install reportlab again.

hope that helps.

see: installing Reportlab (error: command 'gcc' failed with exit status 1 )

Corey Goldberg
  • 59,062
  • 28
  • 129
  • 143
3

The sudo apt-get install python-dev is almost correct. But if you are using Python 3.x you need to change it to install python3-dev. This made all the difference in my django, postgresql, venv setup.

Gary R.
  • 71
  • 4
2

I was also having the same issue while installing readability-lxml a python package. Then I tried installing following packages, and it worked for me.

sudo apt install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev
Waqar Detho
  • 1,502
  • 18
  • 17
0

It majorly depends on the type of packages you suppose to install. Frequently its failing due to the missing of libsasl2-dev a package for authentication abstraction library which uses in the Ubuntu version

First, install:

sudo apt-get install libsasl2-dev

then run:

sudo pip install sasl
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Skanda Shastry
  • 182
  • 6
  • 17
0

I know I am late. But after searching all over this is what solved mine. It need c++ compiler for reportlab. Try Installing g++, the c++ compiler

sudo apt install g++
Starwolf
  • 108
  • 8