Is Kivy installation possible today without building your own wheel? - python-3.x

This link
shows that in order to install Kivy with python3.11, you must build your own "wheel". Unfortunately for me, the above install fails at the "make install" command. "which python" seems to confirm that i am in the correct virtual environment, but i am not certain.
So we know for sure that if, as of today, you have the most recent version of python, which is python3.11, then you must build your own wheel for Kivy.
That stackoverflow link doesnt work for me, so I thought, well I will just install python3.7 or python3.8. Unfortunately www.python.org does not have installers for versions lower than 3.9. www.python.org does have python3.7 and python3.8 available but those versions do not have "macOS 64-bit...installer" available for them. i am reluctant to try a python install manually without the installer.
my reading of the Kivy documentation confirms that Kivy is happy with python3.7 or python3.8.
So for me, because I want to use a python version that has an installer on www.python.org, I cannot install Kivy without building my own wheel. And that installation fails for me.
Any advice?

The answer is YES, Kivy installation is possible today without building your own wheel. Use python3.10 as of today, February 8, 2023. Kivy wheels are already built for phthon3.10. I installed Python3.10 from www.python.org on my mac laptop running Monterey 12.6. Then I followed the Kivy install instructions at www.kivy.org. The instructions worked perfectly and now I can run Kivy apps from the command line. Next step is to synchronize my python IDE with the environment variables that were used to install Python3.10 and Kivy.

Related

Error installing pygame in pycharm (mac, mojave) [duplicate]

I recently bought a new macbook and I've been trying endlessly to get pygame to work, but haven't succeeded yet. I'm getting pretty desperate and I could really use some help.
I've installed pygame 1.9.4 and even though I don't get any error messages when running pygame code, it won't show me anything but a blank screen. I'm using the following code to test it:
import pygame
pygame.init()
screen = pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
quit()
screen.fill((255,0,0))
pygame.display.update()
pygame.quit()
On my old macbook the test code gives me a red screen as expected. Both macbooks are running python 2.7.10.
Does anyone have any idea what I'm doing wrong? I think I installed pygame exactly like I did on my old macbook and the only difference seems to be the operating system.
edit 1:
I write the script in Sublime Text and run the program in Terminal.
Screenshot
edit 2:
I got pygame working again by downgrading my operating system to macOS High Sierra.
Tested and works on macOS 10.15 Catalina, Python 3.7.5, PyGame 2.0.0 (pre-release as of this writing) and PyGame 1.9.6 (stable as of this writing).
Initially you need to decide if you want a stable release or a pre-release (unstable). If you decide to use the latest (and possibly pre-release/unstable) then just ignore the first step ("1. Find the latest stable release version") and use master branch at step 4 of the second step ("2. Install PyGame from source").
1. Find the latest stable release version
Go to PyGame's GitHub page here:
As you can see as of this writing the latest stable release is 1.9.6 so we hold this tag name for later.
2. Install PyGame on macOS from source
Install some dependencies brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf. This requires homebrew.
Go to site-packages:
For virtual environment go to cd ~/.virtualenvs/myvirtualenv/lib/python3.X/site-packages where ~/.virtualenvs/myvirtualenv is the path to your virtual environment and python3.X is the version of your Python.
For system-wide installation go to /usr/local/lib/python3.X/site-packages where python3.X is the version of your Python.
Delete any previous pygame, pip uninstall pygame (if a pygame directory exists in site-packages then remove it: rm -rf pygame*)
Clone PyGame from GitHub:
git clone https://github.com/pygame/pygame.git for the latest (possibly not stable version).
git clone -b 1.9.6 https://github.com/pygame/pygame.git --single-branch for the latest (1.9.6 is the tag name of the latest stable release, as of this writing, see "Find the latest stable release version above")
Go into the newly cloned pygame directory: cd pygame.
Run python setup.py --config --auto --sdl2.
If you get problems with this command, some users below mentioned that single hyphens worked for them, therefore try: python setup.py -config -auto -sdl2.
If you get any problems regarding Python2/3 and you are targeting Python3 try to change python setup.py --config --auto --sdl2 to python3 setup.py --config --auto --sdl2.
Run python setup.py install (it will take a while).
If you get any problems regarding Python2/3 and you are targeting Python3 try to change python setup.py --config --auto --sdl2 to python3 setup.py --config --auto --sdl2.
Now PyGame should work as expected on macOS.
I also face this problem on the macOS Catalina. Actually it is a version problem of pygame. Firstly I have installed with the following command:
pip3 install pygame
An only blank screen was showing. But later on, I have changed the version with the following command:
pip3 install pygame==2.0.0.dev4
With this version my problem was solved. It was working perfectly.
LATEST UPDATE for MacOS 10.14.1
If you download the official macOS x64 installer package of Python 3.7.2 from the official python.org page and type pip3 install pygame, it works.
There's an issue with MacOS. It should be possible to fix in SDL.
https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/8
https://bugzilla.libsdl.org/show_bug.cgi?id=4274
The pygame issue is here: https://github.com/pygame/pygame/issues/555
The homebrew issue is here: https://github.com/Homebrew/homebrew-core/issues/33016
I ran into this issue using macOS Catalina version 10.15.2, Python 3.7.2 and pygame 1.9.6. I upgraded to Python 3.8.1, Pygame 2.0.0.dev6 and it is now working as expected.
I tried upgrading my old macbook to OS Mojave to see if pygame would stop working, and it did!
I guess Mojave isn't compatible with pygame (yet).
Thanks for the help!
Edit with working workaround:
see bottom of post
I get the same problem on a MacBook Pro (Retina display) with python3.7 and MacOs Mojave.
For the sake of simplicity, I did all my tests with your exact same code and pygame 1.9.4.
On (two) Windows computers, the program works and shows a red window on :
python2.7
python3.6
python3.7
Hence it doesn't seem to be a Python version problem, I lean toward a MacOS Mojave problem.
Mojave introduced 'Dark mode' which automatically tint windows. When dark mode is disabled, I get a blank screen. When it is enabled, I get a dark screen. Might it be that MacOS takes control of the screen display and fiddles with the way pygame controls the screen? It is just a theory but I don't know how to test it.
Edit:
I tried a pygame program that records and prints the position of the screen on which you clicked. It does output the position in the console, alas it doesn't display anything.
Apart from the faulty display, pygame seems to work properly.
Edit:
For now, using the Python version from miniconda and using CogSci's pygame seems to work.
I've tried everything but nothing worked except this:
pip install git+https://github.com/pygame/pygame.git
This installs the tips of the pygame. It worked for me. Give it a try.
I ran into this problem with the following environment: Python 3.7, Mojave 10.14.2, Pygame 1.9.4
I found that downgrading to Python 3.6 fixes the issue
$ brew unlink python
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
That should fix it, if you get a circular dependency problem you should then run:
$ brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
Details at https://apple.stackexchange.com/questions/329187/homebrew-rollback-from-python-3-7-to-python-3-6-5-x
I had the same issue, got it to work by downgrading python to 3.6.5.
> brew unlink python brew install --ignore-dependencies
> https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
> brew switch python 3.6.5_1 pip3 install pygame
If you already have python 3.6.5 install I guess you can just use switch.
Some macs need updates. If you go to system preferences and you go to software updates, you could try updating to see if it needs any updates. When you update, you can check to see if your code works now because it looks like your code is correct.

pygame displays blank white screen [duplicate]

I recently bought a new macbook and I've been trying endlessly to get pygame to work, but haven't succeeded yet. I'm getting pretty desperate and I could really use some help.
I've installed pygame 1.9.4 and even though I don't get any error messages when running pygame code, it won't show me anything but a blank screen. I'm using the following code to test it:
import pygame
pygame.init()
screen = pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
quit()
screen.fill((255,0,0))
pygame.display.update()
pygame.quit()
On my old macbook the test code gives me a red screen as expected. Both macbooks are running python 2.7.10.
Does anyone have any idea what I'm doing wrong? I think I installed pygame exactly like I did on my old macbook and the only difference seems to be the operating system.
edit 1:
I write the script in Sublime Text and run the program in Terminal.
Screenshot
edit 2:
I got pygame working again by downgrading my operating system to macOS High Sierra.
Tested and works on macOS 10.15 Catalina, Python 3.7.5, PyGame 2.0.0 (pre-release as of this writing) and PyGame 1.9.6 (stable as of this writing).
Initially you need to decide if you want a stable release or a pre-release (unstable). If you decide to use the latest (and possibly pre-release/unstable) then just ignore the first step ("1. Find the latest stable release version") and use master branch at step 4 of the second step ("2. Install PyGame from source").
1. Find the latest stable release version
Go to PyGame's GitHub page here:
As you can see as of this writing the latest stable release is 1.9.6 so we hold this tag name for later.
2. Install PyGame on macOS from source
Install some dependencies brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf. This requires homebrew.
Go to site-packages:
For virtual environment go to cd ~/.virtualenvs/myvirtualenv/lib/python3.X/site-packages where ~/.virtualenvs/myvirtualenv is the path to your virtual environment and python3.X is the version of your Python.
For system-wide installation go to /usr/local/lib/python3.X/site-packages where python3.X is the version of your Python.
Delete any previous pygame, pip uninstall pygame (if a pygame directory exists in site-packages then remove it: rm -rf pygame*)
Clone PyGame from GitHub:
git clone https://github.com/pygame/pygame.git for the latest (possibly not stable version).
git clone -b 1.9.6 https://github.com/pygame/pygame.git --single-branch for the latest (1.9.6 is the tag name of the latest stable release, as of this writing, see "Find the latest stable release version above")
Go into the newly cloned pygame directory: cd pygame.
Run python setup.py --config --auto --sdl2.
If you get problems with this command, some users below mentioned that single hyphens worked for them, therefore try: python setup.py -config -auto -sdl2.
If you get any problems regarding Python2/3 and you are targeting Python3 try to change python setup.py --config --auto --sdl2 to python3 setup.py --config --auto --sdl2.
Run python setup.py install (it will take a while).
If you get any problems regarding Python2/3 and you are targeting Python3 try to change python setup.py --config --auto --sdl2 to python3 setup.py --config --auto --sdl2.
Now PyGame should work as expected on macOS.
I also face this problem on the macOS Catalina. Actually it is a version problem of pygame. Firstly I have installed with the following command:
pip3 install pygame
An only blank screen was showing. But later on, I have changed the version with the following command:
pip3 install pygame==2.0.0.dev4
With this version my problem was solved. It was working perfectly.
LATEST UPDATE for MacOS 10.14.1
If you download the official macOS x64 installer package of Python 3.7.2 from the official python.org page and type pip3 install pygame, it works.
There's an issue with MacOS. It should be possible to fix in SDL.
https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060/8
https://bugzilla.libsdl.org/show_bug.cgi?id=4274
The pygame issue is here: https://github.com/pygame/pygame/issues/555
The homebrew issue is here: https://github.com/Homebrew/homebrew-core/issues/33016
I ran into this issue using macOS Catalina version 10.15.2, Python 3.7.2 and pygame 1.9.6. I upgraded to Python 3.8.1, Pygame 2.0.0.dev6 and it is now working as expected.
I tried upgrading my old macbook to OS Mojave to see if pygame would stop working, and it did!
I guess Mojave isn't compatible with pygame (yet).
Thanks for the help!
Edit with working workaround:
see bottom of post
I get the same problem on a MacBook Pro (Retina display) with python3.7 and MacOs Mojave.
For the sake of simplicity, I did all my tests with your exact same code and pygame 1.9.4.
On (two) Windows computers, the program works and shows a red window on :
python2.7
python3.6
python3.7
Hence it doesn't seem to be a Python version problem, I lean toward a MacOS Mojave problem.
Mojave introduced 'Dark mode' which automatically tint windows. When dark mode is disabled, I get a blank screen. When it is enabled, I get a dark screen. Might it be that MacOS takes control of the screen display and fiddles with the way pygame controls the screen? It is just a theory but I don't know how to test it.
Edit:
I tried a pygame program that records and prints the position of the screen on which you clicked. It does output the position in the console, alas it doesn't display anything.
Apart from the faulty display, pygame seems to work properly.
Edit:
For now, using the Python version from miniconda and using CogSci's pygame seems to work.
I've tried everything but nothing worked except this:
pip install git+https://github.com/pygame/pygame.git
This installs the tips of the pygame. It worked for me. Give it a try.
I ran into this problem with the following environment: Python 3.7, Mojave 10.14.2, Pygame 1.9.4
I found that downgrading to Python 3.6 fixes the issue
$ brew unlink python
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
That should fix it, if you get a circular dependency problem you should then run:
$ brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
Details at https://apple.stackexchange.com/questions/329187/homebrew-rollback-from-python-3-7-to-python-3-6-5-x
I had the same issue, got it to work by downgrading python to 3.6.5.
> brew unlink python brew install --ignore-dependencies
> https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
> brew switch python 3.6.5_1 pip3 install pygame
If you already have python 3.6.5 install I guess you can just use switch.
Some macs need updates. If you go to system preferences and you go to software updates, you could try updating to see if it needs any updates. When you update, you can check to see if your code works now because it looks like your code is correct.

PyMesh Installation on Python 3.6 Windows

I am trying to install Pymesh on Python 3.6.
In my first try, I installed through pip, however it installed a wrong PyMesh than I wanted.
It installed the following, https://pypi.org/project/pymesh/, while I wanted https://pymesh.readthedocs.io/en/latest/
I uninstalled it, and tried installing the later PyMesh, however no luck. There were no instructions for windows. I downloaded the source from github. I extracted and pasted it in C:\Python36\Lib\site-packages
Then I ran python3 setup.py build - when an error showed up, I also tried python3 setup.py install, which worked. However, I am unable to do a simple basic command mentioned in the web page: https://pymesh.readthedocs.io/en/latest/basic.html
It is saying pymesh does not have module name load_mesh.
Looking for the process or thoughts on how to properly install pyMesh for Windows.
My go to solution for problems like this on Windows is always to try it in a conda env first. If that fails, use Docker.

iPython on Win8 fails to install modules

Please bear with me the total novice of Python 3 and non native English speaker.
I'm using windows 8 in iPython notebook environment, and I have problem installing modules such as Jieba. If you go to its homepage, the English version is in the bottom (however, not as updated as the Chinese version). It says it supports Python 3 as well, so I tried using git as it suggested, but it gave me this (I successfully cloned it before).
Some other things I tried as well
Using cmd to run setup.py
Using pip3 (it's another module I failed to install)
Installing easy_install (same, couldn't install it)
Do I have to use other approaches to install modules cause I'm using iPython notebook? I'm so frustrated. I'm trying to do text mining on some Chinese texts but I struggle so much with this hurdle already.
You've already cloned Jieba into your home directory (~), which is why your second attempt at cloning failed. Enter the jieba directory, and run git pull to sync any changes from the master repo. You can then run python setup.py install in that directory to install the module.
To install pip on Windows, follow the instructions in this question.

Installing pyQT on OSX for python 3.2

NOTE: I'm using python 3
I've been trying to install pyQT on Mac OsX Mountain Lion and I have not had much success so far. I'm fairly new to this so I don't even want to think about setting everything up manually.
Heres the error Im getting which I believe means that there is no easy_install script for installing pyQT. Ive also tried macports however pyQT is not supported for python3 yet on that. Does anyone have any simple solution to getting pyQT installed on osX?
Downloading http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.9.5/PyQt-x11-gpl-4.9.5.tar.gz
Processing PyQt-x11-gpl-4.9.5.tar.gz
error: Couldn't find a setup script in /tmp/easy_install-ZiD0mx/PyQt-x11-gpl-4.9.5.tar.gz
new-host-6:~ Eric$
macports just gives the error "port install not found"
I don't have specific instructions, but here is an overview of what you need
Install Qt: Either via macports, homebrew, source, or a binary build.
Install sip from source
python configure.py --arch=x86_64
make && make install
Install PyQt4 from source. You want the mac source. Not X11 (linux)
python configure.py
make && make install
PyQt4 should locate sip and your Qt install.
You cannot simply install it from easy_install because it is a bit more involved. PyQt depends on SIP and a Qt installation for linking. I recommend homebrew over macports for package installing. You can use it to get Qt: brew install qt

Resources