I was wondering if kivy supports Python 3 on Mac OS X systems. From the download page from the kivy official website, it seems that kivy-1.9.0 is available for Python 3.4 for Windows systems, but it does not seem to support Python 3 on Mac OS X:
Mac OS X Mac OS X 10.9, 10.10 (requires Python 2.7)
Kivy-1.9.0-rev3-osx.dmg (Mirror)
This seems a little but nonsensical, why kivy should support Python 3 on Windows but not on a Mac OS X? It could be because of the missing support of PyGame for Python 3 for OS X systems? Actually, there's a way to install PyGame for OS X systems for Python 3, so I do not understand why they do not fix this problem, if this is really a problem.
I have also tried to install it globally via pip3 using:
sudo pip3 install kivy
But I am getting the following error:
Collecting kivy Downloading Kivy-1.9.0.tar.gz (16.2MB)
100% |████████████████████████████████| 16.2MB 34kB/s
Complete output from command python setup.py egg_info:
Cython is missing, its required for compiling kivy !
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/tmp/pip-build-qt70t_44/kivy/setup.py", line 173, in <module>
from Cython.Distutils import build_ext
ImportError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-qt70t_44/kivy
You will need to build from source.
As a previous poster mentioned, you will need to get Cython installed.
To get the latest version, use
$ pip3 install cython
From there, you need to modify setup.py. Here's an example of how I did it.
According to the error message, you are missing the package cython:
Cython is missing, its required for compiling kivy !
...
ImportError: No module named 'Cython'
You should run pip install cython.
Then installing from source worked for me, by opposition to using pip.
Related
I've recently decided to learn OpenGl in python.
I installed PyOpenGL using pip3 install PyOpenGl PyOpenGl_accelerate. I was then about to follow a
tutorial for PyOpenGL. The first item was to install PyOpenGLContext.
I tried to install PyOpenGLContext with both pip3 install OpenGLContext and pip3 install PyDispatcher PyVRML97 OpenGLContext and both gave me the same error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3r/xfny397j6j98y1sjgh_s574m0000gn/T/pip-build-o7zx54vx/OpenGLContext/setup.py", line 10
except ImportError, err:
^
SyntaxError: invalid syntax
So, there's a syntax error there. How do I get around this? If you need more information, please let me know. I am trying to install this on a MacBook Pro (2013) version for Python3.5.
It should work if you download and install the wheel from Unofficial Windows Binaries for Python Extension Packages:
Download the OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl installation file to a an arbitrary directory.
cd to that directory in a command line and install using pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl
It looks like OpenGLContext has not been updated in a while, and thus is not compatible with Python 3.5.
Having a look at https://pypi.python.org/pypi/OpenGLContext yields that the last update was in 2014.
You probably want to either use an older python version, or a different library.
In Ubuntu 15.10,Running
python3.4 sound.py
leads to this error:
Traceback (most recent call last):
File "sound.py", line 2, in <module>
import pyglet
ImportError: No module named 'pyglet'
I already installed pyglet with running this command:
sudo easy_install -U pyglet
resulting
Searching for pyglet
Reading https://pypi.python.org/simple/pyglet/
Best match: pyglet 1.2.4
Processing pyglet-1.2.4-py2.7.egg
pyglet 1.2.4 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/pyglet-1.2.4-py2.7.egg
Processing dependencies for pyglet
Finished processing dependencies for pyglet
I am confused about what is missing. I guess there are some confusion about different verions of python, pyglet or Ubuntu.
From the install output it seems that the installed version of pyglet goes to python 2.7 packages. From your command you are explicitly calling python 3.4 There might be a problem there. python 3.4 will not go to 2.7's packages to check for the module.
I suggest that you call the script using python 2.7. running just python is enough (the default env python)
You can take a look at this question on the installation of python 2 and 3 packages too
So I'm trying to import AppKit into my python project. I am using pyCharm, but every time I try to import, I get the following error message:
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting AppKit
Using cached AppKit-0.2.8.tar.gz
Collecting flask (from AppKit)
Using cached Flask-0.10.1.tar.gz
Collecting pygobject (from AppKit)
Using cached pygobject-2.28.3.tar.bz2
Traceback (most recent call last):
File "<string>", line 20, in <module
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3p/csss5m7x30ldjd4z0xt6sg380000gn/T/pycharm-packaging0.tmp/pygobject
I've tried running the command directly through terminal etc, and I have upgraded my version of pip to 6.1.1 as well.
Not sure if this is a really beginner's mistake that I am making, or if there is something wrong with my installs of pip or python.
Any advice would be great, thanks :D
First, "importing" and "installing" are not the same thing. Installing is how you get a PyPI package, and all of its dependencies, onto your computer, so you can use its modules. Importing is how you use a module that's already on your computer.
Second, there are two different things named AppKit, and I think you've gotten them confused.
If you're on a Mac, you're almost certainly trying to use import AppKit to get the PyObjC wrapper around the native Cocoa framework named AppKit. If you don't already have PyObjC installed (I believe it comes with Apple's built-in Python on OS X 10.8-10.10), you get it with pip install PyObjC, not pip install AppKit.
If you're on Linux or FreeBSD or similar, you may be trying to import AppKit to get the AppKit framework for building GNOME GUI apps out of HTML and JavaScript. (Although this is in early stages, so I don't think you actually do want it.) For that, pip install AppKit is what you want. But you may need to install some system packages for GNOME development first with apt-get or urpmi or whatever's appropriate for your system.
If you're on Windows or something else, neither one of these makes sense, so… hopefully you're not. :)
The title basically explains it all.
I am running Windows 8 (windows 7 was previously installed... If it helps with answering) and am using Python 2.7.
Upon using the code:
python setup.py install
I am getting this error:
C:\Users\Nicholas\Desktop\taggit>python setup.py install
Traceback (most recent call last):
File "setup.py", line 52, in
from setuptools import setup
ImportError: No module named setuptools
Any help?
Thanks in advance
Nicholas
You need to install setuptools, which allows packages to be configured for your Python installation. It is not included with the default Python installer.
From this link you can download Windows installers for many Python packages (I have linked it directly to setuptools). Make sure you download the version that matches your Python installation.
in Python 3:
pip3 install setuptools
And in Python 2.x:
pip install setuptools
I want to run wexpect (the windows port of pexpect) on my Windows 7 64-bit machine. I am getting the following error:
C:\Program Files (x86)\wexpect\build\lib>wexpect.py
Traceback (most recent call last):
File "C:\Program Files (x86)\wexpect\build\lib\wexpect.py", line 97, in <module>
raise ImportError(str(e) + "This package was intended for Windows like operating systems.")
ImportError: No module named win32console This package requires the win32 python packages.This package was intended for Windows like operatin
g systems.
In the code it is failing on the following line:
from win32console import *
I am using Python 2.6.4. I cannot figure out how to install win32console.
Install this: http://sourceforge.net/projects/pywin32/
Edit to add slightly longer explanation: There's a very useful set of Windows-specific Python modules, called PyWin32. I believe win32console is part of that. You can either install PyWin32 on top of the standard python.org release of Python, or you can install ActiveState ActivePython which bundles everything you need all together. I'm using ActivePython and I have a win32console module.
Install wexpect with pip to install all dependencies (inluding pywin32).
pip install wexpect