Error 'could not read symbols: Bad value' when installing Python - python

i need to install mod_wsgi for Django, but when i do pip install mod_wsgi i have an error:
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LHF3wD/mod-wsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lWmQhZ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-LHF3wD/mod-wsgi/
So i found information about this problem and i tried to reconfigure python like this:
make clean
./configure --enable-shared
make
But now i have the same error after make command:
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
OS: CentOS 6,
python version: 2.7
Also i already have mod_wsgi for Python6.6 (by default. I installed "web server" version of centos)
What is wrong? Thanks.

Related

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

Hey there I'm currently trying to help a host resolve an issue. The issue we getting is error: command 'gcc' failed with exit status 1 we have tried installing the gcc compiler apt-get install python3-dev however it seems to be already installed.
Error:
I/usr/include/python3.7m -c multidict/_multidict.c -o build/temp.linux-x86_64-3.7/multidict/_multidict.o -O2 -std=c99 -Wall -Wsign-compare -Wconversion -fno-strict-aliasing
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-bu65o7vu/multidict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-c0gfiuzu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-bu65o7vu/multidict/
You are using pip version 19.0.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Seán's Discord Bot:~/$
Weirdest t part is that gcc is installed
They use a container based system (docker) and need to find a way to implement it per-container.
Help would be much appreciated.

Failed to pip install regex in Ubuntu

pip install regex is failing on Ubuntu 18.04 server with this error:
I already installed packages mentioned in the supposed to be duplicate question. So this is not a duplicate.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
'Failed building wheel for regex'
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
----------------------------------------
Command "/home/rc/Env/rcasipe/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ti8hji_4/regex/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-i25nnqtk/install-record.txt --single-version-externally-managed --compile --install-headers /home/rc/Env/rcasipe/include/site/python3.6/regex" failed with error code 1 in /tmp/pip-install-ti8hji_4/regex/
How do you fix this? Thanks.
Try: pip3 install regex --user

Error loading cartopy: error: command 'gcc' failed with exit status 1

I am trying to load cartopy onto my system using pip install cartopy
The version of Python environment I am using is 3.5.3, which I am unable to change. I'm getting the following error:
error: command 'gcc' failed with exit status 1
It also gives me this error:
Command "/opt/apps/python/3.5.3/bin/python3.5 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-
eprit6ql/cartopy/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
__file__, 'exec'))" install --record /tmp/pip-4mg12j4p-record/install-
record.txt --single-version-externally-managed --compile --user --prefix="
failed with error code 1 in /tmp/pip-build-eprit6ql/cartopy/
(Sorry it's a little messy)
If there's another way to install using pip or a similar alternative (like basemap for example) that could be recommended that would be helpful too!
Thanks for any help!
Installation instructions recommend to use conda. If you want to install from sources (using pip) you have to install a number of requirements.
PS. And to help us to help you you'd better show us the full error message. 'gcc' failed is not enough to understand what's going on.

Kivy install failed with pip Mac OS Sierra

I get the following error message:
*bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1
I used this command:
"//anaconda/bin/python -u -c "import setuptools,
tokenize;file='/private/var/folders/sg/p9ztjwgx1v1cctrr2hmdymcr0000gp/T/pip-build-y_mai_3m/kivy/setup.py';f=getattr(tokenize,
'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install
--record /var/folders/sg/p9ztjwgx1v1cctrr2hmdymcr0000gp/T/pip-_3c7ty_r-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
/private/var/folders/sg/p9ztjwgx1v1cctrr2hmdymcr0000gp/T/pip-build-y_mai_3m/kivy/
What could be the reason, how to solve this problem?
I figured it out, as Cython was located inside anaconda pip couldn't install kivy, and used pip3 to install Cython and so kivy, now it is installed :) thanks people

Python pip cannot install zbarlight: error: command 'gcc' failed with exit status 1

First of all I installed Python 3.5.1:
yum -y install zbar gcc gcc-c++ kernel-devel
./configure --enable-shared --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
make && make install
Tried to install zbarlight pypi package but failed:
src/zbarlight/_zbarlight.c:137: error: ‘ZBAR_QRCODE’ undeclared (first use in this function)
src/zbarlight/_zbarlight.c:138: error: ‘ZBAR_CODE128’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur77y560/zbarlight/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hoalto9f-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ur77y560/zbarlight/
How do I fix that? I tried pip3.5 -v but doesn't show any more meaningful error.
Had to install
yum install zbar-devel

Categories