KivyMd + Plyer: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent - kivymd

I want to add notifications to my kivyMD app.
First I got this error:
AttributeError: type object 'notification.org.notificator.R$drawable' has no attribute 'icon'.
So I changed my buildozer.spec requirements to include:
https://github.com/kivy/plyer/archive/refs/heads/master.zip
Now I get this error:
JVM exception occurred: org.test.xon: Targeting
S+ (version 31 and above) requires that one of
FLAG_IMMUTABLE or FLAG_MUTABLE be
specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only
use FLAG_MUTABLE if some functionality depends
on the PendingIntent being mutable, e.g. if it needs
to be used with inline replies or bubbles.
java.lang.IllegalArgumentException
In google colab...
sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf
libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev
libtinfo5 cmake libffi-dev libssl-dev
pip3 install --upgrade Cython==0.29.19
pip3 install --upgrade buildozer
buildozer init
buildozer.spec:
android.api = 33
requirements =
python3,kivy==2.1.0,kivymd==1.0.2,sdl2_ttf==2.0.15,pillow,requests,schedule,urllib3,charset_normalizer,idna,kaki,kivy_garden.graph,https://github.com/kivy/plyer/archive/refs/heads/master.zip
Thank you

Related

Install pygame with miniconda3 on Raspberry Pi 4

Probably the solution to my problem is easy, I just do not have enough knowledge to solve it.
I have a Raspberry Pi 4 with Raspberry OS (buster) on it . It comes with python 2.7 and 3.7 preinstalled and they contain pygame package too.
In the meantime I installed miniconda3 and upgraded it to python 3.6. Now I would like to use pygame through this python.
Unfortunately whatever I try I always get some error messages. Probably there is a way to link the pygame in the preinstalled python 3.7 to my miniconda python, but I do not know how to do that. Here is a list what did I try and what error did I get.
I installed the following packages (thinking they could help, but not really):
sudo apt install libsdl1.2-dev
sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg9-dev
sudo apt-get install libtiff5-dev libwebp-dev automake
sudo apt install libsdl2-2.0-0 libsdl2-dev libsdl2-ttf-2.0-0 libsdl2-ttf-dev
Copied the pygame folder from the python3.7/dist-packages to miniconda3/lib/python3.6/site-packages/pygame. When I import the error message is:
File "/home/pi/miniconda3/lib/python3.6/site-packages/pygame/__init__.py", line 136, in <module>
from pygame.base import *
ModuleNotFoundError: No module named 'pygame.base'
sudo apt install python3-pygame: Message:
python3-pygame is already the newest version (1.9.4.post1+dfsg-3).
pip install pygame==1.9.4: Error:
Using UNIX configuration...
Hunting dependencies...
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 22.1.16
Missing dependencies
I guess here I need to install some packages but I do not know how.
I tried from conda too:
conda config --add channels cogsci
conda install -c cogsci pygame
Error message:
PackagesNotFoundError: The following packages are not available from current channels:
- pygame
Current channels:
- https://conda.anaconda.org/cogsci/linux-armv7l
- https://conda.anaconda.org/cogsci/noarch
- https://conda.anaconda.org/rpi/linux-armv7l
- https://conda.anaconda.org/rpi/noarch
- https://repo.anaconda.com/pkgs/main/linux-armv7l
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/linux-armv7l
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/linux-armv7l
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/pro/linux-armv7l
- https://repo.anaconda.com/pkgs/pro/noarch
I see that conda does not see the repository, but I thought I have just added it with the command above.
Could someone tell me, how could I solve this issue?
Thanks
Finally I managed to find out a solution to this problem. Basically tried to solve the problem in point 3. above. I had a few packages missing for pygame. Here are the packages that if you install pygame will not complane:
sudo apt install libsdl1.2-dev
sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg9-dev
sudo apt-get install libtiff5-dev libwebp-dev automake
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
pip install pygame==1.9.4

No package 'libxml++-2.6' found

I want to install something using ./configure but during the process I get this error:
configure: error: Package requirements (libxml++-2.6 >= 2.20) were not met:
No package 'libxml++-2.6' found
I already have tried these two commands but no success:
$sudo apt-get install libxml2
$sudo apt-get install libxml2-dev
# apt-get update
# apt-cache search libxml++
......
libxml++2.6-2v5 - C++ interface to the GNOME XML library (libxml2)
libxml++2.6-dev - C++ interface to the GNOME XML library (libxml2) - dev files
# apt-get install libxml++2.6-2v5 libxml++2.6-dev

gem5 scons build fails with "TypeError: argument should be integer or bytes-like object, not 'str'"

I am trying to install gem5 on a fresh installation of Ubuntu 20.04 and using commit 9fc9c67b4242c03f165951775be5cd0812f2a705. I have used
http://learning.gem5.org/book/part1/building.html
and
https://www.gem5.org/documentation/general_docs/building
as my guide. As near as I can tell, I have installed all the required dependencies using (some dependencies are repeated in these two lines)
sudo apt install build-essential git m4 scons zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev python-dev python
sudo apt install build-essential git m4 scons zlib1g zlib1g-dev \
libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \
python-dev python libboost-all-dev
Then, when I try to build gem5 using
git clone https://gem5.googlesource.com/public/gem5
cd gem5
scons build/X86/gem5.opt -j8
I get the following output after executing the 'scons' line:
scons: Reading SConscript files ...
Warning: Failed to find git repo directory: a bytes-like object is required, not 'str'
TypeError: argument should be integer or bytes-like object, not 'str':
File "/home/john/gem5/SConstruct", line 355:
main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
I am not sure how to fix this error or even why this error is occurring; I don't even really know what this error is saying. Any help would be appreciated.
Yes. That's the result of running a build system implemented in scons expecting only python2.
If you're stuck here's what you can do to be able to compile until the gem project pushes their Python 3 + SCons changes.
sudo apt-get install virtualenv
# create a virtualenv which uses python 2.7
virtualenv -p python2.7 venv27
# activate the virtualenv
. venv27/bin/activate
# Install SCons in the python 2.7 virtualenv
pip install scons
# This will now use the scons installed in a python 2.7 virtualenv.
scons build/X86/gem5.opt -j8
This worked for me on an Ubuntu 20.04 system.

Pip is not linking to my upgraded Python version. Package python3-pip is not available, but is referred to by another package

Having issues linking pip to python 3.7. Both pip and pip3 been installed but linking to Python 2.7.
I have tried to reinstall Python3 and then pip no progress.
I get the following message:
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
$ python --version
Python 3.7.4
$ pip -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
$ pip3 -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
$ sudo apt-get install python3-pip
[sudo] password for TarikDev:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3-pip' has no installation candidate
First use this command
sudo apt-get update
Two packages will be downloaded, of size 16 MB. Then:
sudo apt-get install python2-pip
I tried this and it worked for me:
Step1: sudo apt-get update.
Step2: sudo apt-get install python3-pip
Then check for pip version by typing:
$ pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
go to your sources.list file with the following steps:
cd /etc/apt
sudo nano sources.list
Now edit this line in this file
deb http://http.kali.org/kali kali-rolling main non-free contrib
Now press CTRL+X key and then press y to save the buffer and then press enter.
Now try sudo apt-get update
Now type the command sudo apt-get install python3-pip
First, update the system using the update command
sudo apt-get update
Install pip package to the machine,
sudo apt-get install python2-pip python3-pip
If you are still facing challenges to install pip then try the following commands:
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
pip -V

Install cryptography python module in Python notebook on Bluemix

As suggested here I am trying
!sudo apt-get install build-essential libssl-dev libffi-dev python-dev
!sudo yum install gcc libffi-devel python-devel openssl-devel
!pip install cryptography
which does not work, because I am not allowed to run commands as root.
Run !pip install --user cryptography from a Python notebook.
Explanation: It is correctly stated that one cannot become root on the system. Thus, you cannot run any of the first two commands at all. Also pip install <package> will require access on the system that you do not have. You can tell pip to install things in the user context by providing the --user option.
As for the first two commands, you don't need (one of) them, they are already satisfied; the libs are already installed system-wide.

Resources