After properly installing Kivy on my Mac I got the following error. Can anyone help me out?
MacBook-Pro-van-Jackie:~ jackie$ kivy
File "
import os; print os.path.realpath(os.path.dirname('/Applications/Kivy.app/Contents/Resources/script'))
^
SyntaxError: invalid syntax
/usr/local/bin/kivy: line 9: /venv/bin/activate: No such file or directory
/usr/local/bin/kivy: line 37: /python: No such file or directory
/usr/local/bin/kivy: line 37: exec: /python: cannot execute: No such file or directory
How exactly did you install kivy?
pip install kivy
Op 28 dec. 2015, om 16:11 heeft Akshay Arora [email protected] het volgende geschreven:
How exactly did you install kivy?
—
Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/3874#issuecomment-167585908.
But the shared exception comes from sdk code: http://kivy.org/downloads/1.9.0/Kivy-1.9.0-rev3-osx.dmg.
Maybe you've installed it both ways?
that might be the problem. What can i do to resolve it?
Anybody there to help me out? I tried to install it on another mac but had the same issue.
pip uninstall kivy
Just use the method highlighted in kivy download page for OS X, i.e install
kivy.app
On Wed, Dec 30, 2015 at 3:40 PM, Jackie Janssen [email protected]
wrote:
Anybody there to help me out? I tried to install it on another mac but had
the same issue.—
Reply to this email directly or view it on GitHub
https://github.com/kivy/kivy/issues/3874#issuecomment-167972238.
Hi,
I retried it (also removed everything yesterday on my other Mac).
Reinstalled it and did the MakeSymlinks. Same message.
Seems I’d better give up on using kivy
:-(
Last login: Wed Dec 30 15:31:47 on ttys000
iMac-van-Jackie:~ jackiejanssen$ kivy
File "
import os; print os.path.realpath(os.path.dirname('/Applications/Kivy.app/Contents/Resources/script'))
^
SyntaxError: invalid syntax
/usr/local/bin/kivy: line 9: /venv/bin/activate: No such file or directory
/usr/local/bin/kivy: line 37: /python: No such file or directory
/usr/local/bin/kivy: line 37: exec: /python: cannot execute: No such file or directory
iMac-van-Jackie:~ jackiejanssen$
Op 30 dec. 2015, om 13:47 heeft Akshay Arora [email protected] het volgende geschreven:
pip uninstall kivy
Just use the method highlighted in kivy download page for OS X, i.e install
kivy.appOn Wed, Dec 30, 2015 at 3:40 PM, Jackie Janssen [email protected]
wrote:Anybody there to help me out? I tried to install it on another mac but had
the same issue.—
Reply to this email directly or view it on GitHub
https://github.com/kivy/kivy/issues/3874#issuecomment-167972238.—
Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/3874#issuecomment-167991322.
@janssja it seems you have python3 as the default for your python for some reason, can you confirm this?
Just type python --version
and paste the output here
I do. Is kivy not compatible with python3?
iMac-van-Jackie:~ jackiejanssen$ python --version
Python 3.5.1 :: Anaconda 2.4.1 (x86_64)
Op 30 dec. 2015, om 15:36 heeft Akshay Arora [email protected] het volgende geschreven:
@janssja https://github.com/janssja it seems you have python3 as the default for your python for some reason, can you confirm this?
Just type python --version and paste the output here
—
Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/3874#issuecomment-168011972.
There is a py3 test package, but the download page does state that the currently published one requires Python 2.7
.
In case you want to test the new py3 package: http://kivy.org/downloads/tests/Kivy3.7z.
Hi, I followed the install instructions on download page (kivy.app) here is my error and python --version.
Tried the version 3 and version 2. Feel the same as Jackie, give up and try something else. Saw in some comments Kivy wasn't ready yet. What are your ideas?
/Applications/Kivy.app/Contents/Resources/python: line 1: ./venv/bin/python: No such file or directory
MacBook-Pro:/ $ python --version
Python 2.7.10
Guys please do not use the test packages, use the packages from the kivy's
download page. kivy.org/#download
The packages from test folder mentioned above is bound to have issues,
it's only for internal tests using master and not the released version.
On Mon, Jan 11, 2016 at 1:54 AM, Frank Harland [email protected]
wrote:
Hi, I followed the install instructions on download page (ivy.app) here is
my error and python --version.Tried the version 3 and version 2. Feel the same as Jackie, give up and
try something else. Saw in some comments Kivy wasn't ready yet. What are
your ideas?/Applications/Kivy.app/Contents/Resources/python: line 1:
./venv/bin/python: No such file or directoryMacBook-Pro:/ $ python --version
Python 2.7.10—
Reply to this email directly or view it on GitHub
https://github.com/kivy/kivy/issues/3874#issuecomment-170390352.
That's what I just wrote, I used the kivy.app downloaded from kivy.org/#download.
@harri00413 which version of the package do yo have? When did you download it? can yo give me the filename and date of creation of the .7z you use and paste the error log you get.
1st: Thanks for your help.
2nd: filenames and dates copied from terminal
-rw-r--r--@ 1 usernamechanged staff 46M 1 jan 02:36 Kivy-1.9.1-osx-python2.7z
-rw-r--r--@ 1 usernamechanged staff 58M 1 jan 02:36 Kivy-1.9.1-osx-python3.7z
3rd: error log
/Applications/Kivy.app/Contents/Resources/python: line 1: ./venv/bin/python: No such file or directory
This is the error I see in Terminal when trying to start kivy. I have not found an error log.
Need the entire log including the command you use to start your app, btw
the python3.7z has been updated, please download that again. If you are
using that.
On Mon, Jan 11, 2016 at 4:16 PM, Frank Harland [email protected]
wrote:
1st: Thanks for your help.
2nd: filenames and dates copied from terminal
-rw-r--r--@ 1 usernamechanged staff 46M 1 jan 02:36
Kivy-1.9.1-osx-python2.7z
-rw-r--r--@ 1 usernamechanged staff 58M 1 jan 02:36
Kivy-1.9.1-osx-python3.7z3rd: error log
/Applications/Kivy.app/Contents/Resources/python: line 1:
./venv/bin/python: No such file or directoryThis is the error I see in Terminal when trying to start kivy. I have not
found an error log.—
Reply to this email directly or view it on GitHub
https://github.com/kivy/kivy/issues/3874#issuecomment-170505787.
The command I used to test kivy was "kivy" as was described in the guideline on this page:
https://kivy.org/docs/installation/installation-osx.html
I searched the log files in the Console app but nothing relating to "kivy" was found.
@harri00413 this file 1 jan 02:36 Kivy-1.9.1-osx-python3.7z is old and was updated, please re-download the package re-install and try again.
I’ll try, coming weekend. Thanks for your help so far.
Groeten,
Frank Harland
Op 14 jan. 2016, om 20:46 heeft Akshay Arora [email protected] het volgende geschreven:
@harri00413 https://github.com/harri00413 this file 1 jan 02:36 Kivy-1.9.1-osx-python3.7z is old and was updated, please re-download the package re-install and try again.
—
Reply to this email directly or view it on GitHub https://github.com/kivy/kivy/issues/3874#issuecomment-171757106.
Same here. First time installing Kivy, downloaded from https://kivy.org/#download
-rw-r--r--@ 1 xxx staff 48506699 Dec 31 20:36 Kivy-1.9.1-osx-python2.7z
Extracted, moved the app bundle to /Applications and created the suggested link. Note that the link suggested here points to a non existent directory:
$ ln -s /Applications/Kivy.app/Contents/Resources/script /usr/local/bin/kivy
The app bundle in the distribution above is Kivy2.app
.
When attempting to run one of the examples, I get the same results:
---:/Applications/Kivy2.app/Contents/Resources/kivy/examples/audio$ kivy main.py
/Applications/Kivy2.app/Contents/Resources/python: line 1: ./venv/bin/python: No such file or directory
The (relevant) environment right before ./venv/bin/python
is invoked:
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Kivy2.app/Contents/Resources/lib
GIO_EXTRA_MODULES=/Applications/Kivy2.app/Contents/Resources/../Frameworks/GStreamer.framework/Versions/Current/lib/gio/modules
GST_PLUGIN_SCANNER=/Applications/Kivy2.app/Contents/Resources/gst-plugin-scanner
GST_PLUGIN_SYSTEM_PATH=/Applications/Kivy2.app/Contents/Resources/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0
GST_REGISTRY=/Applications/Kivy2.app/Contents/Resources/gst.registry
GTK_PATH=/Applications/Kivy2.app/Contents/Resources/../Frameworks/GStreamer.framework/Versions/Current
KIVY_HOME=/Applications/Kivy2.app/Contents/Resources/.kivy
LD_PRELOAD_PATH=/Applications/Kivy2.app/Contents/Resources/lib
PATH=/Applications/Kivy2.app/Contents/Resources/venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
PWD=/Applications/Kivy2.app/Contents/Resources/kivy/examples/audio
PYTHONPATH=/Applications/Kivy2.app/Contents/Resources/kivy:
VIRTUAL_ENV=/Applications/Kivy2.app/Contents/Resources/venv
Replacing ./venv/bin/python
with its full path (/Applications/Kivy2.app/Contents/Resources/venv/bin/python
) gets me this:
---:/Applications/Kivy2.app/Contents/Resources/kivy/examples/audio$ kivy
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Applications/Kivy2.app/Contents/Resources/venv/bin/python
Reason: no suitable image found. Did find:
/Applications/Kivy2.app/Contents/Resources/venv/bin/../.Python: file too short
/Applications/Kivy2.app/Contents/Resources/venv/bin/../.Python: file too short
/Applications/Kivy2.app/Contents/Resources/python: line 3: 48516 Trace/BPT trap: 5 /Applications/Kivy2.app/Contents/Resources/venv/bin/python
No time to debug further today. I will see what I can dig later.
Is there any more information on this? Because I keep running into the same problem, both with the kivy2 and kivy3 package.
Still occurring. (It looks like this OS X release may never even have been tested?)
The root of the problem appears to be a number of files that should be symlinks instead instead coming through as single-line text files:
$ pwd
/Applications/Kivy2.app/Contents/Resources/venv
$ file .Python
.Python: ASCII text, with no line terminators
$ cat .Python
/System/Library/Frameworks/Python.framework/Versions/2.7/Python
Fixing that .Python
file makes the initial launch of the script work, but then there are other failures down the line with similar causes.
Broken packaging on Kivy’s side? Or I wonder if perhaps the 7z file isn't being extracted correctly?
It looks like the 7z file is the culprit: some Macs open 7z files using Stuffit Expander by default, and it apparently fails to extract symlinks.
Keka works.
I’d strongly recommend distributing Kivy using something that OS X’s built-in extractor knows how to deal with, such as .dmg.bz2
or even boring old .zip
.
I have absolutely no idea how this happened or if this info is of any help to anyone ever, but the installation using pip suddenly worked for me after I installed pygame separately.
Excellent sleuthing @pcantrell! I would not have found that. As you say probably not well tested with os x. Had given up but will look into this when time = abundant.
I have absolutely no idea how this happened or if this info is of any help to anyone ever, but the installation using pip suddenly worked for me after I installed pygame separately.
That's how I ended up installing. Cleaner and simpler than the _App_ thing, which never worked. I created my own _virtualenv_, installed the dependencies and it all works there.
7z? Why use some weird format when there are standards that work everywhere? So it's 1% more efficient (presumably)? You save about a millisecond on download time and a month trying to figure out why things don't work...
Most helpful comment
It looks like the 7z file is the culprit: some Macs open 7z files using Stuffit Expander by default, and it apparently fails to extract symlinks.
Keka works.
I’d strongly recommend distributing Kivy using something that OS X’s built-in extractor knows how to deal with, such as
.dmg.bz2
or even boring old.zip
.