Python Gstreamer for Lion - python

I've been working on a Kivy project, and I want it to be able to play video, but I've been having a terrible time trying to install Gstreamer. I tried brew install gst-python, but I get the following message, which is fairly meaningless to me.
brew install gst-python
==> Installing gst-python dependency: pygtk
==> Downloading http://ftp.acc.umu.se/pub/GNOME/sources/pygtk/2.24/pygtk-
Already downloaded: /Library/Caches/Homebrew/pygtk-2.24.0.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/pygtk/2.24.0
checking for pkg-config... no
checking for GLIB - version >= 2.8.0... no
*** A new enough version of pkg-config was not found.
*** See http://www.freedesktop.org/software/pkgconfig/
configure: error: gobject is required to build pygtk?
Based on the freedesktop site, I have to clone a repository, but is there a specific location that the repository needs to be in? Is there an easier way to get Gstreamer, like pip, or do I have to go through all this to get it?

This is one of the reasons why the official package contains gstreamer and all other dependencies. You should download and use the official package, that way you will not have to worry about installing gstreamer and other required packages.

Related

Error in building wheel for cryptography while installing firebase-admin on raspberry pi 3

I was installing firebase-admin using pip on my raspberry pi 3b+ using the following command:
pip3 install firebase-admin
However it always ends with an error saying "Error building wheel for cryptography"
Here is the full error message:
/tmp/pip-build-env-k7qo7p54/overlay/lib/python3.7/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in packages.
!!
############################
# Package would be ignored #
############################
Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package,
but it is not listed in the `packages` configuration of setuptools.
'cryptography.hazmat.bindings._rust' has been automatically added to the distribution only
because it may contain data files, but this behavior is likely to change
in future versions of setuptools (and therefore is considered deprecated).
Please make sure that 'cryptography.hazmat.bindings._rust' is included as a package by using
the `packages` configuration field or the proper discovery methods
(for example by using `find_namespace_packages(...)`/`find_namespace:`
instead of `find_packages(...)`/`find:`).
You can read more about "package discovery" and "data files" on setuptools
documentation page.
!!
check.warn(importable)
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.7.3
platform: Linux-5.10.103-v7+-armv7l-with-debian-10.13
pip: n/a
setuptools: 67.0.0
setuptools_rust: 1.5.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
This package requires Rust >=1.48.0.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
I have tried different commands like:
pip3 install firebase-admin
or
python -m pip install firebase-admin
I have upgraded pip and tried again, but still it didn't work
I faced a similar problem long time ago and solved by installing openssl. Tried it this time, it didn't work
Also tried installing rust compiler and using it but it didn't work
I am using Raspbian OS Buster on my Raspberry Pi 3
I have tried fresh installs of the OS
Still the same problem occurs

Using PIP to install Pillow in a Flatpak

I've added a new function to a Python program which works when I run the program on my PC, but it isn't working in my Flatpak. I assumed that it was probably because the Pillow version on my PC (8.3.2) is rather more recent than that in the Flatpak manifest (5.4.1). The problem is that I can't get the Flatpak to build with the later version. I'm no expert on PIP or Flatpaks. Relevant part of manifest:
- name: python3-pillow
buildsystem: simple
build-commands:
- pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} Pillow
sources:
- type: file
# url: https://files.pythonhosted.org/packages/3c/7e/443be24431324bd34d22dd9d11cc845d995bcd3b500676bcf23142756975/Pillow-5.4.1.tar.gz
# sha256: 5233664eadfa342c639b9b9977190d64ad7aca4edc51a966394d7e08e7f38a9f
# try later version of pillow
url: https://github.com/python-pillow/Pillow/archive/refs/tags/8.3.2.tar.gz
sha256: 8252b6b514aed2743abb5b7259b3253d6c4bf86902b9c5acd33fe79d24ec7b2f
Relevant part of Flatpak building output:
=======================================================================
Building module python3-pillow in /home/me/.flatpak-builder/build/python3-pillow-8
========================================================================
Running: pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} Pillow
Looking in links: file:///run/build/python3-pillow
ERROR: Could not find a version that satisfies the requirement Pillow (from versions: none)
ERROR: No matching distribution found for Pillow
Error: module python3-pillow: Child process exited with code 1
END ================================================================================================
It looks as though it fails to download the tarball, but if I put the address into a browser, it downloads.
The problem is that pip is searching for a file in $PWD (/run/build/python3-pillow/) and it can't find a file that matches your system and your python version. So eather you didn't download any thing due to an error in the manifest file or you are downlaoding the wrong file.
I can't find any errors in the manifest, at least on the part that you posted.
Have you tried to use a wheel file rather then a tar.gz archive?
A list of them for the latest pillow version are here.
I don't know what runtime you are using for flatpak but the (org.freedesktop.Sdk-21.08) runtime has python v3.9.9 and i can assume that your app is for x86_64 so i think that Pillow-9.2.0-cp39-cp39-manylinux_2_28_x86_64.whl should work with you.
Answer here: Python Forum
Blah, blah.

Build documentation on ReadTheDocs fails on requirement shapely (due to libgeos)

While getting the documentation of a python repository right, I stumpled upon the issue that the package requirement shapely cannot be install on ReadTheDocs (RTD).
The log says:
Searching for shapely
Reading https://pypi.python.org/simple/shapely/
Best match: Shapely 1.6a1
Downloading https://pypi.python.org/packages/83/3b/99d5d0e266c3bf5f361c76ff046a539eaf96a4e9ca1beaef5121dcaf5cdc/Shapely-1.6a1.tar.gz#md5=a2efe87371d8186f5cbeadc0c153c546
Processing Shapely-1.6a1.tar.gz
Writing /tmp/easy_install-7zplo9iy/Shapely-1.6a1/setup.cfg
Running Shapely-1.6a1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7zplo9iy/Shapely-1.6a1/egg-dist-tmp-t5eb3ob8
Failed `CDLL(libgeos_c.so.1)`
Failed `CDLL(libgeos_c.so)`
error: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']
The actual problem is that libgeos is missing on RTD which is required to install shapely. Usually, you install libgeos by sudo apt-get install libgeos-dev. This does not work on RTD.
Does someone has any clue on that? In particular, I'm looking for a solution how to tell RTD to install additional system packages. I'm curious if this is possible at all.
RTD does not support installing additional c libs as stated in their FAQs, there's a discussion about this issue on git.
As written in the FAQ, you can only "mock out" these libs to avoid import errors.

installing pyside using PIP - nmake not found

I want to install PySide using PIP package manager. But it get this error message saying it didn't find nmake. This is no surprise because I do not have MSVC installed nor do I intend to.
Installing collected packages: pyside
Running setup.py install for pyside
Removing c:\users\cnyffele\appdata\local\temp\pip_build_cnyffele\pyside\pyside_package
Python architecture is 32bit
nmake not found. Trying to initialize the MSVC env...
Searching MSVC compiler version 9.0
error: Failed to find the MSVC compiler version 9.0 on your system.
However the setup.py program could simply run make:
C:\Users\cnyffele>where make
C:\MinGW32-xy\bin\make.exe
C:\Users\cnyffele>where mingw32-make
C:\MinGW32-xy\bin\mingw32-make.exe
But for some reason, it insists that if the platform is "win32" it should use msvc without trying anything else. It does, however, accept command-line options: I could specify "make-spec" to be "mingw" (see below).
From https://github.com/PySide/pyside-setup/blob/master/setup.py
OPTION_MAKESPEC = option_value("make-spec")
...
if sys.platform == "win32":
if OPTION_MAKESPEC is None:
OPTION_MAKESPEC = "msvc"
if not OPTION_MAKESPEC in ["msvc", "mingw"]:
print("Invalid option --make-spec. Available values are %s" % (["msvc", "mingw"]))
sys.exit(1)
How can I make setyp.py use the correct make when installing with PIP? Is there a way to have PIP provide command-line options to setup.py when it runs it? If this is not possible, how can I run setup.py manually after PIP downloaded it?
PIP allows passing options to setup via the options '--global-option' and '--install-option' as described in the pip reference guide.
The solution is:
pip install --global-option="--make-spec=mingw" PySide
Some additional information:
That prior to installing PySide using pip, you have to install cmake and Qt 4.8.
Build errors prevented me from downloading and installing PySide directly via pip. I needed to download the wheel binary packages from pypi.python.org.
Using a pre-downloaded .whl package, assuming the package is located in the current working directory:
pip install --global-option="--make-spec=mingw" PySide-1.2.4-cp27-none-win32.whl

Installing gevent in virtualenv

I am just starting with virtualenv, but I am trying to install gevent within a virtualenv environment (I am running Windows). When I use PIP from virtualenv, I get this error:
MyEnv>pip install gevent
Downloading/unpacking gevent
Running setup.py egg_info for package gevent
Please provide path to libevent source with --libevent DIR
The package index has MSIs and EXEs for installing on Windows (http://pypi.python.org/pypi/gevent/0.13.7), but I don't know how to install those into a virtualenv environment (or if that is even possible). When I try pip install gevent-0.13.7.win32-py2.7.exe from the virtualenv promp, I get an error as well:
ValueError: ('Expected version spec in', 'D:\\Downloads\\gevent-0.13.7.win32-py2.7.exe', 'at', ':\\Downloads\\gevent-0.13.7.win32-py2.7.exe')
Does someone know how to do this?
Pip doesn't support installing binary packages, yet. If you want to install from binary package you have to use easy_install - easy_install gevent-0.13.7.win32-py2.7.exe
Microsoft Windows XP [Wersja 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
Z:\>virtualenv z:\venv\gevent-install
New python executable in z:\venv\gevent-install\Scripts\python.exe
Installing distribute..................................................................................................
............................................................................................done.
Installing pip.................done.
Z:\>venv\gevent-install\Scripts\activate
(gevent-install) Z:\>easy_install c:\python\packages\gevent-0.13.7.win32-py2.7.exe
Processing gevent-0.13.7.win32-py2.7.exe
creating 'c:\docume~1\pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg' and adding 'c:\docume~1
pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg.tmp' to it
creating z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Extracting gevent-0.13.7-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding gevent 0.13.7 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Processing dependencies for gevent==0.13.7
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading https://github.com/python-greenlet/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.3.4-py2.7-win32.egg#md5=9941aa246358c586bb274812e
130629
Processing greenlet-0.3.4-py2.7-win32.egg
creating z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Extracting greenlet-0.3.4-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding greenlet 0.3.4 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Finished processing dependencies for gevent==0.13.7
(gevent-install) Z:\>
See Can I install Python windows packages into virtualenvs? Another option is to install from source and you can do this with pip but this requires setting up compiler and environment which is much harder than the simple command above.
From the error message, it would appear you need libevent source code. I would imagine you need to go a step further and compile/install libevent system-wide so pip can find it.
I would start by downloading the latest stable source from http://libevent.org/.
Compile and install it using instructions in the README: https://github.com/libevent/libevent#readme
To compile it on Windows, you'll need to use GNU-style build utilities like make and autoconf. I recommend http://www.mingw.org/.
Once you've installed libevent system-wide, I imagine pip will find it and proceed with gevent installation.
In the msi for gevent-0.13.7 there's an option to select an alternate installation point. point it to the root dir of your particular virtual environment (just above where /Lib and /Scripts are located). That should install it correctly.
You also need to make sure greenlets are installed. For that you can use Piotr's suggested method with easy_install on the .exe.

Categories