Error installing module with pip on Ubuntu 15.10 - python

I have trouble installing modules using pip, for example
sudo -H pip3 install kivy
returns this error
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b3rwh_e6/kivy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bev6v2mx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-b3rwh_e6/kivy/
I am fairly new to python and to programming in general so I'm probably doing something wrong, it's probably worth mentioning that I have python2.7 and python3.5 installed, and installing the packages python3.5-dev and build-essential didn't fix it.
Edit: build log:
https://drive.google.com/file/d/0B5e3GD1lfCbUZ19LU3RENzY4MU0/view?usp=sharing

Packages which include C extensions require compilation and so might require both gcc and python-dev (and in some cases gcc-c++).
run:
sudo apt-get install gcc python-dev
prior to pip installing your package.

Have you tried to install
sudo apt-get install python-dev
for python2.7 ?
From the official site
https://kivy.org/docs/installation/installation-linux.html
for python 2
sudo apt-get install python-kivy
for python 3
sudo apt-get install python3-kivy

Related

Can't roll back cryptography; was not uninstalled | During sudo pip install mitmproxy

I'm trying to run the following command: sudo pip install mitmproxy on my Raspberry Pi 3.
Running the command, I have run into a couple of problems with different things failing due to certain libraries missing, and those were simple fixes. This one in particular, I cannot seem to be able to fix it:
Can't roll back cryptography; was not uninstalled Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-3ZDe_T/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-record-wmW08I/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-3ZDe_T/cryptography/
I have tried the following commands:
sudo apt-get install libffi-dev
sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
All pretty much doing the same thing, but in different ways.
I'm not really sure what to do. Here is the full log.
Thanks!

Installing requirements.txt throws an error on Django

The project was working perfectly until recently when I created a model for my database and tried to pip install requirement.txt. I have done everything I know including modifying my settings.py to add the missing library, reinstalling django and psycopg2, all to no avail. Here's my requirement.txt:
tweepy==3.8.0
django
gunicorn
django-heroku
The error i'm getting:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/apple/Downloads/font_text/python-getting-started/getting-started/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/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/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-record-sc3y24vo/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/###/###/PROJECTFOLDER/getting-started/include/site/python3.7/psycopg2" failed with error code 1 in /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/
Based on the error message, you need to install the openssl-devel package on your system.
After long hours of searching and experimenting, I finally was able to solve the problem. But I'm still investigating on what really could have caused the error. Anyways, here's what fixed it
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip install psycopg2
I found it here: error installing psycopg2, library not found for -lssl
You need to reinstall gcc , gcc-c++ and dependencies.
For python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
For python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
Hope this will help.

Unable to install igraph on python 3.7

I need to install python-igraph into python 3.7 through pip3.
When I run: pip3 install python-igraph, I get this message error:
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-whiv93xm/python-igraph/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-kbqa7cno-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-whiv93xm/python-igraph/
For information, i had it on python 2.7.
Thank you.
You might need to install some dependencies before installing the library.
Try this:
sudo apt install libxml2-dev libz-dev python-dev python3-dev build-essential
Then proceed with:
sudo pip3 install python-igraph
I hope this works

Install Matplotlib on Buildozer VM

I downloaded the Virtual Machine (for Android/Buildozer) from here.
I need to install Matplotlib on this virtual machine, but I am not able to.
I already tried the following in the terminal:
sudo pip install matplotlib
sudo apt-get build-dep python-matplotlib
python -mpip install matplotlib
I get the following error:
posixsybprocess.c:16:20: fatal error: Python.h: No such file or directory
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5xFopz/subprocess32/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-Q8TTao/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5xFopz/subprocess32/
Can anyone help me with that?
try this:
sudo apt-get install libfreetype6-dev libpng-dev
then
sudo apt-get install python-pip
sudo pip install matplotlib
if it's not working:
sudo apt-get install python-matplotlib
or just
sudo apt-get install matplotlib
If it's not working at first try to upgrade and update the apt-get, then try one more time

Downloading dlib on Raspberry Pi, pip keeps outputting error when I try?

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dhth2xud/dlib/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-7p82qhms-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dhth2xud/dlib/
This is the error I keep getting, when simply running sudo pip3 install dlib.
I ran into the same error. Turns out you need to install those prerequisits on the Raspberry Pi:
sudo apt-get install build-essential cmake
sudo apt-get install libgtk-3-dev
sudo apt-get install libboost-all-dev
I read that it helps to free up RAM by disabling GUI start (sudo raspi-config and under Boot options change from GUI to Console) but that alone didn't help.
I then followed the Ubuntu installation instructions here (the 3 commands above) and then sudo pip3 install dlib stopped showing this error and started installation.

Categories