Install pygame with miniconda3 on Raspberry Pi 4 - python-3.x

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

Related

python-rocksdb installation -llz4 missing inside /usr/bin/ld

With the installation of python-rocksdb on ubuntu i had the following issue of missing packages:
Then i run:
apt-get install build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev
allmost all sorted, the only one that i can't find is -llz4. Anyone know what is the pacakge that i need to install?
At the moment whenever i run
pip install python-rocksdb
i always received the error
Sorted!
sudo apt-get install liblz4-dev

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

pip3 is broken and not installing packages anymore

I used to install python3 packages via pip3, however since today it is not working anymore.
Checking my history gives me this:
lkjhr#X1-Carbon-6:~$ history | grep pip3
562 pip3 install matplotlib
1029 pip3 install flask
However, since today I noticed that it is not working at all, look like I broke it or something?
lkjh#X1-Carbon-6:~$ pip --version
pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
lkjh#X1-Carbon-6:~$ pip3 --version
The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip
lkjh#X1-Carbon-6:~$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
The following packages were automatically installed and are no longer required:
libgsoap8 libvncserver1 linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic linux-headers-4.4.0-135
linux-headers-4.4.0-135-generic linux-image-4.15.0-29-generic linux-image-4.4.0-135-generic
linux-image-extra-4.4.0-135-generic linux-modules-4.15.0-29-generic linux-modules-extra-4.15.0-29-generic
linux-signed-image-4.4.0-135-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
lkjh#X1-Carbon-6:~$ python3-pip install bokeh
python3-pip: command not found
lkjh#X1-Carbon-6:~$ pip3 install bokeh
The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip
What could go wrong? (surprised)
Thanks in advance,

Cant install python3-pyqt5 on ubuntu 17

I`m trying to install python3-pyqt5, but still getting the same error. I tried reinstalling ubuntu, updating and upgrading my apt-get and still no clue whats wrong.
ubuntu#ubuntu:~$ sudo apt-get install python3-pyqt5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-pyqt5
I found that I just needed to type:
sudo add-apt-repository universe
then
sudo apt-get update
And everything was working fine.
I had the same problem. After doing some reading, I was able to install pyqt5 using this workaround:
Install python3-setuptools:
$ sudo apt-get install python3-setuptools
Install pip:
$ sudo easy_install3 pip
Finally, install pyqt5 using pip:
$ pip3 install --user pyqt5

ubuntu scipy works for python2.7 but not for 3.2

I have tried many ways to get scipy to play nice with python3.2 but no joy yet.
I have tried:
sudo apt-get build-dep scipy
no joy
and
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
and still no joy
The goal is to get scipy to play nice with ipython running python3.2.
Here is the terminal output.
http://pastebin.com/LkPZUSAX
help / assistance is appreciated.
try:
sudo apt-get install python32-numpy
if you have multiple versions of python installed on your system then you have to specify the version for which you want to install the library..
also you can do
python --version
to check the default python for your system
Try running the command
sudo apt-get install python3.2-numpy
instead.
Running the command
sudo apt-get install python-numpy
installs for python2.7 be default in my case.
So one must specify the python version in apt-get command.

Resources