biomed
biomed

Reputation: 647

virtualenv gcc error

IF I use --no-site-packages option while creating a virtualenv and try to install MySQL-python afterwards I get :

error: command 'gcc' failed with exit status 1

Here are the steps I followed:

easy_install-2.7 --install-dir ~/src/lib/ virtualenv==dev
~/src/lib/virtualenv  --no-site-packages ENV
.../ENV/bin/pip-2.7 install MySQL-python

I also tried downloading mySQL-python and install using

.../ENV/bin/python setup.py build

I get the same error wither way. I assume I am missing the gcc from this virtualenv but how do I get it installed in this virtualenv while still using --no-site-packages option. thanks

EDIT: as per below comments here is the whole error output.

running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -m32 -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/opt/lampp/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv
In file included from /opt/lampp/include/python2.7/Python.h:58,
                 from pymemcompat.h:10,
                 from _mysql.c:29:
/opt/lampp/include/python2.7/pyport.h:849:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
In file included from /usr/include/mysql/my_config.h:11,
                 from _mysql.c:36:
/usr/include/mysql/my_config_x86_64.h:1032:1: warning: "SIZEOF_LONG" redefined
In file included from /opt/lampp/include/python2.7/Python.h:8,
                 from pymemcompat.h:10,
                 from _mysql.c:29:
/opt/lampp/include/python2.7/pyconfig.h:989:1: warning: this is the location of the previous definition
error: command 'gcc' failed with exit status 1

Upvotes: 2

Views: 2882

Answers (2)

mdressman
mdressman

Reputation: 51

you need the mysql-devel package. to install, you need to specify the actual package name -

sudo apt-get install libmysql++-dev

Upvotes: 1

Vijay
Vijay

Reputation: 934

Have you tried using the sudo command. I am guessing you are having permission issues than issue with anything else here. Usually an install throws up this error as it is trying to access directories with root permission which you don't own.

Upvotes: 0

Related Questions