Install GTK+ >= 3.16 with PyGObject bindings on MacOS 10.15 - macos

when I'm typing the command
brew install pygobject3 --with-python#2 gtk+3
I'm always getting the error message
invalid option --with-python#2
I'm getting the same error message when I want to run the gtk+3 under mac os 10.15
Namespace Gtk not available
Maybe the Version of 10.15 of MacOS the problem....
gtk+3 version 3.24.12 and pygobject3 Version 3.34.0 are installed.
Installation of homebrew for MacOS
gtk+3 version 3.24.12 and pygobject3 Version 3.34.0 are installed.
Python3.7 is installed
File "...anaconda3/envs/python37/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
I would like to run the program DemonEditor on MacOS 10.15 (Catalina)
to make some settings of my engima2 satellite receiver, for this I need the requirements "GTK+ >= 3.16 with PyGObject bindings".
Maybe some of the experts can help me.
Thanks very much

Since I am the author of this program, I am forced to report that since the program is designed for Linux, it will not work on MacOS without minor changes to the program itself. But still it’s possible.
DemonEditor
Тo resolve dependencies, it is enough to install as follows:
brew install gtk+3 pygobject3 adwaita-icon-theme
pip3 install requests
Upd.
I created an experimental brunch and added small changes to the program for the possibility of testing the launch in the MacOS. Perhaps not all the functionality will work (I have not tested it), but the program should start.
Gud luck!

STRIKE. It works, I can start the DemonEditor-GUI under 10.15. I have remove all packages via the
brew remove --force $(brew list)
installed the three packages again, via
brew install python3 gtk+3 pygobject3 adwaita-icon-theme
BUT. The most important step was to add the "Installation folder" of the brew packages to my python path but execute the comand
export PYTHONPATH=/usr/local/lib/python3.7/site-packages.
My assumption is, that due to fact, that I have installed an own conda-environment for python37, the site-packages have to be added to the path.
Big thanks for the help.

On my test system, I did not set any paths or environment variables! Just installed python 3 with the command:
brew install python3
Then I installed the dependencies as described above.Then I downloaded the archive from here, and in the unpacked folder of the program I simply gave the command:
./start.py
Below is the output of the commands python3 --version and brew list
Compare with your list, perhaps this will somehow help identify the missing components.
python3 --version
Python 3.7.4
brew list
adwaita-icon-theme libepoxy
atk libffi
cairo libpng
fontconfig librsvg
freetype libtiff
fribidi lzo
gdbm openssl#1.1
gdk-pixbuf pango
gettext pcre
glib pixman
gobject-introspection pkg-config
graphite2 py2cairo
gsettings-desktop-schemas py3cairo
gtk+3 pygobject3
harfbuzz python
hicolor-icon-theme python#2
icu4c readline
jpeg sqlite
libcroco xz
Upd. For the experiment, I removed all my packages with the command:
brew remove --force $(brew list)
Then again installed by commands as described above
brew install python3 gtk+3 pygobject3 adwaita-icon-theme
Working!

Related

How can I run Python 3.9.1 natively on M1 Mac?

Seems to be impossible currently with Anaconda as well as with Xcode 12. Via idle, it runs via Rosetta. There seems to be no discussion of this so either I'm quite naive or maybe this will be useful to others as well.
Python says: "As of 3.9.1, Python now fully supports building and running on macOS 11.0 (Big Sur) and on Apple Silicon Macs (based on the ARM64 architecture). A new universal build variant, universal2, is now available to natively support both ARM64 and Intel 64 in one set of executables" https://docs.python.org/3/whatsnew/3.9.html
Please help a newbie figure out how to take advantage of his recent impulse-buy.
You can now install python 3.9.1 through multiple pathways now but the most comprehensive build environment for the full data-science suite for python at the moment (Feb 2021) on M1 ARM architecture is via miniforge.
e.g.
brew install --cask miniforge
conda init zsh
conda activate
conda install numpy scipy scikit-learn
You can now install Python 3.9.4 natively on Mac M1 (Apple Silicon). I'm using pyenv to install Python 3.7, 3.8 and 3.9 all native ARM. For example, to install 3.9.4:
$ pyenv install 3.9.4
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.4 to /Users/squademy/.pyenv/versions/3.9.4
For a complete guide on install pyenv and multiple Python version, you might read this article: https://squademy.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9.
I am using python3.9.4. I installed it using homebrew only.
brew install python#3.9
Also you may want to do the following to unlink and check the version number
brew unlink python3
brew link python3.9
python3 --version
I upgraded to 3.9.4
Download the Python universal installer -
https://www.python.org/downloads/mac-osx/
Note: I still could not get sudo pip install mysqlclient to install.
I had add to
update homebrew - See https://brew.sh
Add /opt/homebrew/bin to PATH in .bash_profile (don't forget to source .bash_profile)
or
Add /opt/homebrew/bin to PATH in .zprofile (don't forget to source .zprofile) if using zsh

pdf2swf not installed through Homebrew – but the rest of swftools are

Environment OSX 10.9.5
I am trying to install swftools so that I can use pdf2swf. I am installing through HomeBrew. I've seen various notes about pdf2swf failing to install if its dependencies have not been previously installed. So using the command at the link I use:
$ brew install freetype libjpeg giflib swftools
And it completes without error – except pdf2swf is not installed. When I look in usr/local/bin, I see the other swftools are installed successfully.
Does anyone know what might be wrong?
Update: For completeness if anyone comes across this question looking to use pdf2swf in an AIR desktop app: you can't. Apparently pdf2swf compiles the swf with certain "AllowDomain" security settings and there is no option to not do that. Short of editing the source code and compiling pdf2swf oneself, it seems a deadend.
If you look at the brew formula: brew edit swftools, PDF support comes via xpdf and this is not included by default as XQuartz needs to be installed:
brew instal swftools --with-xpdf
swftools: XQuartz is required to install this formula.
You can install with Homebrew Cask:
brew install Caskroom/cask/xquartz
You can download from:
https://xquartz.macosforge.org
Error: An unsatisfied requirement failed this build.
So:
Install XQuartz
brew install swftools --with-xpdf

I'm having trouble setting up Kivy with Pygame on Mac OS X [duplicate]

I have following issue of installing pygame package.
In file included from src/_numericsurfarray.c:23:
src/pygame.h:106:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
^
1 error generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
System information
Mac OS-10.9.2
python version- Python 2.7.5 :: Anaconda 1.6.1 (x86_64)
Any suggestion will be greatly appreciate ? Thanks.
Here (OSX Mavericks) I got able to install this way:
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
pip install https://bitbucket.org/pygame/pygame/get/default.tar.gz
("default" branch is on commit e3ae850 right now)
Source: https://bitbucket.org/pygame/pygame/issue/139/sdlh-not-found-even-thought-it-exists#comment-3822470
See this other StackOverflow question too: PyGame in a virtualenv on OS X with brew?
I had the same issue. I tried all versions of the answers to this question including variations of pip and pip3. Finally, the one that worked for me was:
sudo easy_install pygame
Note, however, that: (1) https://setuptools.readthedocs.io/en/latest/easy_install.html says that easy_install is deprecated and recommends using pip. (2) pygame is installed in the old standard python 2.7 folder rather than in the python 3.8.3 that I just installed -- though I was able to use it successfully in VSCode.
My system is also OSX10.9.2,and I also meet you problem,and I'm still try some;
Maybe this will be help for you:
there are some step:
1.Install [Quartz](https://xquartz.macosforge.org/landing/);
2.Install Xcode-Command-Line,
but you may cant install it by `xcode-select --install`,
so you can down from
https://developer.apple.com/downloads/index.action ;
I suggest you setup xcode,and this really solute my some problem;
3.`brew tap homebrew/headonly`
`brew install smpeg --HEAD`
`brew install sdl sdl_image sdl_mixer sdl_ttf portmidi`
4. `sudo pip install hg+http://bitbucket.org/pygame/pygame`;
if you clone this repo and try `python setup.py install`,you may meet some weird problem;
I have try install kivy which is base on pygame and I try lots of times,but just success install pygame one time.Then I uninstall it and also can't install it ;(
some refer:
http://jamesfriend.com.au/installing-pygame-python-mac-os-108-mountain-lion
http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lion/
=======update
Now I have install pygmae sucess,remeber you should install xcode,not only xcode-command-line!
I managed to install pygame on Mac OSX 10.14.4 using the following:
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
sudo -H pip3.8 install pygame
This Work for me:
If you haven't installed Python/pip via homebrew (you're using the system-installed Python), you would likely need to run sudo pip3 install pygame.
Before running  pip3 install pygame, I had also installed Command Line Tools for XCode), as well as XQuartz, and the following homebrew packages: brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi.
If homebrew fails to install smpeg you might need to do the following:
brew tap homebrew/headonly
brew install --HEAD smpeg
Source: http://jamesfriend.com.au/installing-pygame-python-mac-os-108-mountain-lion

RVM requirements error

I have OS X Mavericks installed and I'm trying to run rvm requirements in terminal and it gives me this error.
Installing required packages: autoconf, automake, libtool, pkgconfig, libyaml, libffi, readline, libksba, curl-ca-bundle, gdbm.............
Error running 'requirements_osx_port_libs_install autoconf automake libtool pkgconfig libyaml libffi readline libksba curl-ca-bundle gdbm',
please read /Users/Alex/.rvm/log/ruby-1.9.3-p448/1374263757_package_install_autoconf_automake_libtool_pkgconfig_libyaml_libffi_readline_libksba_curl-ca-bundle_gdbm.log
Requirements installation failed with status: 1.
It looks like RVM tried to install some dependencies using Macports and Macports proceeded to get really confused about dependencies when it tried to install autoconf.
Try running:
brew install autoconf
Otherwise you should run this bash script:
https://gist.github.com/siraj/1399288
Assuming you have brew, which you should if you don't.
If your Macports just isn't working, then you can manually install all of the requirements like this:
brew install autoconf automake libtool pkgconfig libyaml libffi readline libksba curl-ca-bundle gdbm
I tried the above, and a few other things. None worked.
It seems that on OSX 10.9 and XCode5 moved some libs around on us. So I had to install XCode5-DP6 (Dev Preview 6), opened up DP6 and in the settings, you have to tell the command line tools to use the new DP6 build and not the Standard XCode from the marketplace.
First, I had to install homebrew. Nothing liked to play with macports. I am on my first mac as of only a month ago, so macports was just what solved apache for me at the time. I then had to run 'brew install autoconf'
Once I did that I then ran rvm requirements, everything installed without issue. then sudo gem install jekyll from there and it all works like a charm now.
I'm sure once Mavericks is actually released this will get ironed out. We are using early releases after all...
Hope this works for you guys.

How to install Scipy with pip on Mac Mountain Lion OS X v10.8

I'm having serious difficulty installing Scipy with pip on Mountain Lion.
I've tried:
sudo pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev
As suggested in various places on the web.
This leads to errors like:
ld: library not found for -lgcc
lipo: can't figure out the architecture type of: /var/tmp//ccC2HLVs.out
and several warnings (I assume not serious) before the errors.
Does anybody have any suggestions?
Scipy is also available now via a homebrew tap. If you have homebrew installed:
brew tap samueljohn/python
brew install scipy
See more info here: homebrew-python
Pip has difficulties with scipy on OS X in general. It is not trivial to install from the sources, so I advise against it. In OS X you have a few better options:
Scipy superpack, a bunch of precompiled binaries
Enthought Canopy (free or another) has already everything you'll need (numpy, scipy, matplotlib, etc.)
Anaconda, a free scientific python distribution with probably all the packages you'll ever need.
MacPorts, a comprehensive and flexible package manager that allows you to install and maintain a python distribution
Homebrew, another popular package manager for OS X
Here is what worked for me for pip installing matplotlib and scipy inside a virtual environment (Mac OS X 10.9.2 Mavericks):
# See George's answer above
brew update
brew upgrade
brew install gfortran
# See http://www.scipy.org/scipylib/building/macosx.html (the link Nathan Gould posted above)
export CXX=g++-5.1
export CC=gcc-5.1
export FFLAGS=-ff2c
sudo ln -s /usr/bin/gcc /usr/bin/gcc-5.1
sudo ln -s /usr/bin/g++ /usr/bin/g++-5.1
pip install matplotlib
pip install scipy
matplot lib installed quickly, but scipy took a long time.
Just to add to what #Anton I. Sipos said. I had the Enthought package installed but had issues with upgrading it, so I decided to go with a clean install using Homebrew. Unfortunately just performing the tap and install didn't work well for me. So on searching a bit I found an issue on GitHub that samualjohn addressed and worked for me:
brew remove python
rm -rf /Library/Python/2.7/site-packages # it's save to delete this!
brew install python
pip install nose
brew install numpy
brew install scipy
The problem was clearly conflicts in the site-packages that the Enthought uninstall instructions did not cover.
NOTE: I had to install matplotlib with pip.
I had similar issues installing scipy on OSX 10.9 Mavericks as well. What solved it for me is the following:
sudo pip list
was showing numpy, thus I did:
sudo pip install --upgrade numpy
Afterwards
brew list
was showing gfortran. I made sure I had the latest version by
brew update
brew upgrade
but
sudo pip install scipy
was failing with a weird fortran error.
Thus I uninstalled it and reinstalled it
sudo brew install gfortran
sudo brew uninstall gfortran
and to my great surprise
sudo pip install scipy
worked after that.
I recently also had trouble getting scipy to install on a virtualenv. My problem was that gfortran was not seen properly. I used macports sudo port install gcc48 and created a symlink to just gfortran by:
sudo ln -s /opt/local/bin/gfortran-mp-4.8 /opt/local/bin/gfortran
After that, pip install scipy worked without any errors on my virtualenv.
Installing scipy on Mac OS X with pip is possible! You will need the right C and Fortran compilers on your system to set up scipy. This page should help you:
http://www.scipy.org/scipylib/building/macosx.html
Once you have done that, you should be able to install with pip install scipy.
As an additional troubleshooting note, you might need to create a symlink to your compiler so that the setup process can find it. A previous poster #biophetik gave an example of how to do this.
Also, I already had numpy installed in my virtual environment when I installed scipy. I'm not positive whether/how one depends on the other.
On Mavericks the following works (might also work on other versions):
If you haven't already, install pip
sudo easy_install pip
Then install/update scipy
sudo pip install scipy -U
For some reason pip installs scipy to
/Library/Python/2.7/site-packages/
and does not remove the older version in
/System/Library/Frameworks/Python.framework/Versions/2.7//Extras/lib/python/scipy/
So just remove the old version and it works. Print the version number:
python -c "import scipy; print scipy.__version__"
I tryed everything: pip, macports,easy_install,... with Mac OS El Captain. The only thing that worked for me was brew:
$ brew install scipy
After that, it will ask you to follow the instructions bellow:
$ brew link --overwrite numpy
$ mkdir -p /Users/adrieljr/Library/Python/2.7/lib/python/site-packages
$ echo 'import sys; sys.path.insert(1, "/usr/local/lib/python2.7/site-packages")' >> /Users/adrieljr/Library/Python/2.7/lib/python/site-packages/homebrew.pth

Resources