pip install python-novaclient is failing due to netifaces.c - python-2.7

I'm trying to install OpenStack python novaclient using pip install python-novaclient
This task fails: netifaces.c:185:6 #error You need to add code for your platform
I have no idea what code it wants.
Does anyone understand this?

I also had this problem, and resolved by
sudo yum install python-devel python-pip
sudo yum -y install gcc

Same issue in awx_task container in AWX project (Centos 7), trying to execute
pip install python-openstackclient
Error was:
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LTchWP/netifaces/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-86uBIZ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-LTchWP/netifaces/
Solved with:
yum install python-devel python-pip gcc
Hope it will help someone!

This has to do with the order that libraries are imported in the netifaces setup.py and is fixed in version 10.3+ (which you need to install from source). Here's how to install 10.4 (current latest release):
mkdir -p /tmp/install/netifaces/
cd /tmp/install/netifaces && wget -O "netifaces-0.10.4.tar.gz" "https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e"
tar xvzf netifaces-0.10.4.tar.gz
cd netifaces-0.10.4 && python setup.py install

I landed on this question while doing something similar:
pip install rackspace-novaclient
And this is what my error looked like:
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-G5GwYu/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Jugr2a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-G5GwYu/netifaces
After reading the entire output logs, I realized I was missing "gcc" and just needed to install it.
On CentOS 7, my fix was:
yum -y install gcc && pip install rackspace-novaclient

Related

pip python-geohash problem during execution of command

pip install python-geohash
I get the following error:
Failed building wheel for python-geohash
....
tokenize;file='/private/var/folders/y8/blhw9jx1133b9pyg6jbb4c100000gn/T/pip-install-8c750u/python-geohash/setup.py';f=getattr(tokenize,
'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install --record
/private/var/folders/y8/blhw9jx1133b9pyg6jbb4c100000gn/T/pip-record-01O7KL/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
/private/var/folders/y8/blhw9jx1133b9pyg6jbb4c100000gn/T/pip-install-8c750u/python-geohash/
Can you help me how to download python-geohash. I think it is related to gcc
I use macOS Mojave version 10.14.4
Download the .whl file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-geohash
And use pip install python_geohash‑0.8.5‑cp37‑cp37m‑win_amd64.whl

issues with: pip install fiona

I have some issues to install fiona on ubuntu 14.04
I always get the error
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b4ng2wm0/fiona/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-uj6y8dyt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-b4ng2wm0/fiona/
I already tried: sudo -H pip install fiona as well as sudo pip install -U setuptools, python -m pip install fiona, sudo apt-get install python-software-properties, sudo add-apt-repository ppa:ubuntugis/ppa
Any other idea what could be tried out?
Many thanks in advance.

Installing scrapy in Lubuntu using pip install scrapy (or sudo ) and getting the following error

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nExfhn/cryptography/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-dpob_w-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-nExfhn/cryptography/
So I have tried :
1) pip install scrapy (with pip 9.0.1 so no need to update)
2) sudo pip install scrapy (still getting the same error)
I have setup the scrapy framework in Windows environment but in Linux seems different and I also get this Cryptography error.

Python - pip install markupsafe

So i want to install markupsafe and get this following error:
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\appdata\\local\\temp\\pip-build-yb_vy0\\markupsafe\\setup.py';ex
ec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'
), __file__, 'exec'))" install --record c:\users\appdata\local\temp\pip-h
xgnlp-record\install-record.txt --single-version-externally-managed --compile" f
ailed with error code 1 in c:\users\appdata\local\temp\pip-build-yb_vy0\m
arkupsafe\
anyone got an idea how to fix it?
you need install Microsoft Visual C++ Compiler for Python 2.7 if you are using windows else sudo apt-get install gcc gcc-c++ if is not OS windows

Sentry compile fails with " error: command 'gcc' failed with exit status 1"

Been trying to install Sentry on CentOS 6.5. I have installed the prerequisites i.e Python 2.7.9
[root#localhost poduori]# python -V
Python 2.7.9
I used pyenv to change from the pre-installed python version 2.6.6 (pyenv install 2.7.9). When I try to install sentry I get the below output and error;
NB: I had already run it once hence it using cached.
pip2.7 install sentry
The full error output can be found here https://www.dropbox.com/s/64w6b7dswgzs9cb/Sentry_error.txt?dl=0
or
Sentry error txt file
A summary of the error I'm getting is below
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/.pyenv/versions/2.7.9/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-PSGsNT/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-UYMAyw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-PSGsNT/cffi
The output was too long to post here so I used dropbox instead.
libffi is already installed.
root#localhost user]# rpm -qa|grep libffi
libffi-3.0.5-3.2.el6.x86_64
I already installed all the development tools,
yum groupinstall "Development tools" (including gcc compiler) but I still get the same error. Kindly assist.
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
c/_cffi_backend.c:13:17: error: ffi.h: No such file or directory
You need to install dev packages first one (it let you out of this w/ pre-built libs) is libxslt-dev, second one is python-dev. Exact names depends on your distro.
Using ubuntu i solved this by:
Installing setuptools with :
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
created a file requisits.sh
inserted the content:
#! /bin/bash
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install python-dev
sudo apt-get install setuptools
sudo apt-get install python-pip
sudo apt-get install libxslt1-dev
sudo apt-get install libxslt-dev
sudo apt-get install libxml2-dev
sudo apt-get install libz-dev
sudo apt-get install libffi-dev
sudo apt-get install libssl-dev
put execution chmod +x requisits.sh
executed:
./requisits.sh
entered the password and answered y/n when prompted.
and finally :
if using virtualenv:
pip install -U sentry
else
sudo pip install -U sentry