Kivy Installation via Makefile - python

I'm tearing what's left of my hair out trying to figure out how to install Kivy on Linux. I'm a newb to pretty much everything, so not incredibly surprising, but I'm trying to make a Makefile that will install the necessary dependencies for my app that I build via Kivy.
This is my Makefile:
#!/bin/sh
all: packages program
packages:
sudo apt-get install python3-kivy
sudo apt-get install python3-pip
sudo apt-get install python-setuptools python-dev build-essential
sudo apt-get install python3-dev
sudo apt-get docutils-doc python3-pygame python-pil-doc python3-pil-dbg ttf-bitstream-vera
sudo easy_install pip
sudo apt-get -f install
pip install --upgrade pip
pip3 install python3-weather-api
sudo pip install requests
pip3 install beautifulsoup4
pip3 install Cython
pip3 install h5py
pip3 install kivy
program:
python3 project.py
This is the output:
sudo apt-get install python3-kivy
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-kivy is already the newest version (1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python3-kivy : Depends: python3-kivy-common (= 1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1) but it is not going to be installed
Depends: python3-kivy-bin (= 1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Makefile:5: recipe for target 'packages' failed
It keeps saying to run apt-get -f install, which I did, but the same error keeps popping up.

Related

Unable to install `gattlib`

I am trying to install gattlib in Python in order to use some of its Bluetooth-tools.
The OS is ubuntu 18.04.4 LTS.
I have by now tried the following (as e.g. here):
sudo apt-get install mercurial
hg clone https://bitbucket.org/OscarAcena/pygattlib
cd pygattlib
cat DEPENDS
sudo apt-get install libboost-thread-dev libboost-python-dev libbluetooth-dev libglib2.0-dev python-dev
sudo python3 setup.py install
which gives (my Python is 3.6.9):
usr/bin/ld: cannot find -lboost-python36
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
Also, I tried:
sudo apt install python3-gattlib
which gives:
the following packages have unmet dependencies:
python3-gattlib: Depends: python3 (>= 3.7~) but 3.6.7-1~18.04 is to be installed
Depends: libboost-python1.67.0 but is is not installable
Depends: libboost-thread1.67.0 but is is not installable
despite libboost-python and libboost-thread being successfully installed in the first attempt (see above), and python3 returning Python 3.6.9.
pip3 install gattlib
shows:
Building wheel for gattlib(setup.py) ... error
Running setup.py install for gattlib ... error
Which is the exact same result that I get from (following instructions from this question):
sudo pip3 download gattlib
sudo tar xvzf ./gattlib-0.20200122.tar.gz
cd gattlib-0.20200122/
sudo sed -ie 's/boost_python-py34/boost_python36/' setup.py
pip3 install .
in which I understand to be a necessary adjustment of the installation file before running it, because, if I understood correctly, the python version is somehow wrongly hardcoded in there.
Futher things I tried and that did not help:
pip3 install --upgrade setuptools
sudo apt-get install python3.6-dev libmysqlclient-dev
sudo apt-get install libmysqlclient-dev
sudo apt-get install python-dev
sudo apt-get install libpython-dev
sudo apt-get install libevent-dev
sudo pip3 install gattlib
wget -qO- http://pike.esi.uclm.es/add-pike-repo.sh | sudo sh
sudo apt update
sudo apt install python3-gattlib
sudo apt-get install libbluetooth-dev
pip3 install --upgrade pip
sudo apt-get install mercurial
pip3 install gattlib
sudo apt-get install libboost-all-dev
cd /usr/lib/x86-64-linux-gnu
sudo ln -s libboost_python-py35.so libboost_python-py36.so
sudo apt-get install libbluetooth-dev bluez bluez-hcidump libboost-python-dev libboost-thread-dev libglib2.0-dev
hg clone https://bitbucket.org/OscarAcena/pygattlib
cd pygattlib
cat DEPENDS
sudo apt-get install libboost-thread-dev libboost-python-dev libbluetooth-dev libglib2.0-dev python-dev
sudo python3 setup.py install
sudo python setup.py install
pip3 install gTTS
sudo apt-get install python3 python-dev python3-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
python-pip
sudo apt-get install aptitude
sudo aptitude install libboost-all-dev
I run
sudo python3 setup.py install
and I also get error
usr/bin/ld: cannot find -lboost-python36
because I don't have boost-python36.a but boost-python3-py36.a.
(I found this file using locate boost-python3 which uses database with filenames so it works faster then find but it may not be installed as default)
I had to edit setup.py and change
boost_libs = ["boost_python3"+str(sys.version_info.minor)]
to
boost_libs = ["boost_python3-py36"]
or more universal
boost_libs = ["boost_python3-py3"+str(sys.version_info.minor)]
Tested od Linux Mint 19.3 Tricia based on Ubuntu 18.04
You need to install python-dev that contains the header files for the Python C API. The following should do the trick (make sure to replace X with your Python version):
sudo apt-get install python3.X-dev
With ubuntu 20.04:
$ wget https://github.com/oscaracena/pygattlib/releases/download/v.20201113/python3-gattlib_0.20201113-1_amd64.deb
$ sudo apt install ./python3-gattlib*.deb
$ pip3 install gattlib
Reference:
https://pypi.org/project/gattlib/
NOTE: This didn't work for me!
sudo apt install pkg-config libboost-python-dev libboost-thread-dev libbluetooth-dev libglib2.0-dev python-dev

How to install python packages like pip, numpy on Amazon EC2 - ubuntu

Need to install python packages like pip, numpy, cv2 on an Amazon EC2 instance of Ubuntu. I tried using sudo apt-get install python-pip but got below given error:
ubuntu#ip-172-31-35-131:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
Try first sudo apt-get update then
sudo apt-get install python-pip
Have you tried the instructions here?
You can install pip from PyPa directly:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
Your system may have a concurrent python3.x under the name python3, then you can install pip for it with python3 get-pip.py --user as well. (Or contrarily, python2.x under the name python2.)

How do I install langid python library from github?

I have attempted the following:
sudo pip install git+https://github.com/saffsd/langid.py.git
However I get the following error.
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
However both python-dev and numpy are already installed.
selah#selah-OptiPlex-9020:~$ dpkg -s python-numpy
Package: python-numpy
Status: install ok installed
...
and
selah#selah-OptiPlex-9020:~$ dpkg -s python-dev
Package: python-dev
Status: install ok installed
...
Any ideas of what I could try next?
Install langid's dependencies and directly the version 1.1.4 from pypy
sudo pip install https://pypi.python.org/packages/source/l/langid/langid-1.1.4dev.tar.gz

How to install Django in Ubuntu 11.10

I am very new to Ubuntu OS and Python as well. I want to install Django. But i dont have easy_install and I tried below command to install pip
sudo apt-get install python-pip
I got an error as below
Unable to locate package python-pip
I tried below command as well
sudo apt-get install python-pip
and i got error as below
E: Package 'python-setuptools' has no installation candidate
I am very confused in installing django, How to successfully install django
First update repositories
sudo apt-get update
then try
sudo apt-get install python-pip python-dev build-essential python-setuptools
if nothing, you can install pip and setuptools packages manually. Download them from PyPI.
Install pip
To install or upgrade pip, securely download get-pip.py.
Then run the following (which may require administrator access):
sudo python get-pip.py
If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
To upgrade an existing setuptools (or distribute), run pip install -U setuptools
Upgrade pip
On Linux or OS X:
sudo pip install -U pip
Then you can download django using pip,
sudo pip install django
Install
First you need make sure you have Python install, here I take 2.7.6 as example. For how to install Python, you can go check this link:
https://askubuntu.com/questions/443048/python-2-7-6-on-ubuntu-12-04-how-to
Then you can start install Django and setup database as follow:
sudo apt-get install python-django
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
You can find more configuration detail in this link
http://yuwenqing.org/?p=108
Also, for less pain in future develop, you should deploy your Django application in python virtualEnv, here are some detail of why you need virtualEnv.
http://yuwenqing.org/?p=126

Can't install mitmproxy:

Im trying to install mitmproxy on a Ubuntu 14.04 computer, but I'm getting error. I found on the web how I should install it by using this code:
sudo install pip mitmproxy
So I installed python, now when I run the command it works until I get this problem:
Command python.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
I tried to update python but still the same
Exactly I installed python in this way:
sudo apt-get install python-pyasn1 python-flask python-urwid
What's wrong???
UPDATE
Here is the pip.log
You can also pip install from github:
In this order:
Install netlib: (sudo) pip install git+https://github.com/mitmproxy/netlib.git
Install mitmproxy: (sudo) pip install git+https://github.com/mitmproxy/mitmproxy.git
This will install all requisite libraries and provide you with the most up-to-date version of mitmproxy.
Judging by the log you got from pip the problem here is that the development libraries for libffi are not installed. You can rectify it with:
$ sudo apt-get install libffi-dev
and retry installing.
The clue in your error log is this line:
Package libffi was not found in the pkg-config search path.
If pkg-config is unable to find a library it means that the files needed to develop with this library are missing. On an Ubuntu or Debian system this usually means installing the package that has the name of the library plus -dev.
Running these 2 commands worked for me (Ubuntu 14.04)
sudo apt-get install python-pip python-dev libffi-dev libssl-dev
libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
sudo pip install mitmproxy
EDIT: You need to run this command before you will be able to use "mitmproxy -p port_number". since it gives error "Error: mitmproxy requires a UTF console environment."
export LC_ALL=en_US.UTF-8
EDIT 2: After installation, you need to generate certificate first and have to transfer it into your device then setup manual proxy by entering your computer's IP address and port on which you will run mitmproxy server. Use below commands to generate certificate:
sudo apt-get install libnss3-tools
certutil -d sql:$HOME/.pki/nssdb -A -t C -n mitmproxy -i ~/.mitmproxy/mitmproxy-ca-cert.pem
$ pip uninstall mitmproxy netlib
$ sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip libxml2-dev libxslt-dev git
$ sudo pip install git+https://github.com/mitmproxy/netlib.git#master
sudo pip install git+https://github.com/mitmproxy/mitmproxy.git#master
$ sudo python #
>>> from netlib import certffi
>>> exit()

Categories

Resources