When attempting to install kivy as described in the docs https://kivy.org/docs/installation/installation-osx.html I run into a similar error as was described in #4669.
Heres my installation process
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
no issues...
pip install -U Cython
no issues
'pip install kivy'
error:
... building 'kivy.graphics.svg' extension
/usr/bin/gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -arch i386 -arch x86_64 -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-1_stgghk-build/kivy/include -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-1_stgghk-build/kivy/include -I/Users/Matt/Development/projects/sermon_uploader/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-1_stgghk-build/kivy/graphics/svg.c -o build/temp.macosx-10.6-intel-3.6/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-1_stgghk-build/kivy/graphics/svg.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-1_stgghk-build/kivy/graphics/svg.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
1 error generated.
error: command '/usr/bin/gcc' failed with exit status 1
Any ideas? I thought clang was supposed to be used since i have the latest version of Xcode installed, but it still seems to be trying to use gcc.
Let me know if there's any other information i can provide that would be helpful.
Python 2.7
MacOS 10.12
I was trying to install Kivy on my mac(sierra), it took me quite sometime to figure it out. Give this a shot.
pip install 'Cython===0.26.1'
From the documentation it asked you to install Cython
, by
pip install -U Cython
but it couldn't compile when installing Kivy, and I found in Kivy's git repo, it didn't use the latest version of Cython, instead if uses version 0.26.1
pip install --user kivy
Without the --user
flag it will throw an error saying
“OSError: [Errno 1] Operation not permitted”
Good Luck.
@leyuan Thanks for the suggestion. I will try you later tonight and report back.
@leyuan It looks like i still run into the same error trying your suggestion:
error: command '/usr/bin/gcc' failed with exit status 1
I'm wondering if the error might have something to do with the following warning note in the kivy docs:
Warning
By default, versions 2.7 to 2.7.2 of Python use the gcc compiler which ships with earlier versions of XCode. As of version 4.2, only the clang compiler is shipped with XCode by default. This means that if you build using XCode 4.2 or above, you need to ensure you have at least Python 2.7.3 installed, but preferably the latest version (2.7.5 at the time of writing).
According to that, it sounds like maybe my python3 installation with Xcode 9.0 shouldn't be using gcc but rather clang.
@leyuan @meichthys ....I am on mac os 10.13, latest version of xcode and python version 2.7.10.
I was trying to install kivy but i used to get the same error as @meichthys would get.
Now I have tried @leyuan's method and I got no error....
Finally i have successfully installed (kivy-1.10.0)....
Thanks to @leyuan ......:)
@meichthys , i think your python version 3.5 is giving you some problem...(just my guess)...
@gshanbhag525 Thanks for your input. Yes, it does seem to be something to do with the version of python i'm trying to use (3.6).
This is just a guess, but you could try setting these 3 env vars before installation: https://github.com/kivy/kivy/blob/master/.travis.yml#L90L92.
@dessant Thanks for pointing those env vars out. I'll take a look at setting those, and will report back if i have any luck.
@dessant I am using high sierra and latest xcode and python 2.7.10. I am getting an error when i type import kivy in python shell....Am I missing some step after installation of kivy (brew and pip method).
And I wanted to try the installation using app method.....but sadly i didn't get any app2 or app3 module to move in my applicatons folder so used brew and pip. Strangely though there was no file called app2 in downloaded kivy 1.10.0 tar file...:(
Please any one help:(
@gshanbhag525, it sounds like you're mixing up installation methods, Kivy.app is no longer available for download, we recommend installing with brew and pip, for easier integration with your dev env. Follow these steps to install Kivy: https://kivy.org/docs/installation/installation-osx.html#using-homebrew-with-pip.
@dessant Thanks ...It worked finally and i have created a demo app and ran...:)
I have one doubt...when i go into Kivy-1.10.0 folder and run command as "python -c import kivy" i see the kivy is working....
but when i try to run the same command from any other folder like kivy/examples folder i get stdin error....
Can you please tell me how to overcome this .... i need to know this as i want to create separate folders for my android applications and run the main.py from that particular folder instead ...please help:)
I'm not sure, you may have better luck by asking on IRC or the mailing list: https://github.com/kivy/kivy#support.
:) ok
@gshanbhag525 Hey, have you followed the steps provided by @dessant, if you followed these apps kivy will be available in virtualenv/globally and there is no need for you to run "python -c import kivy" in Kivy-1.10.0 folder.
Try to follow these steps: https://kivy.org/docs/installation/installation-osx.html#using-homebrew-with-pip. and if you encounter any error, please paste logs as I have tested kivy with high-sierra and its working fine.
@manthansharma Hey, Are u referring to @dessant 's "try setting 3 env vars before installation" steps ? If Yes, then can you please explain me lil bit in detail because i didn't get that :(
No, these steps are for using clang to compile kivy, I am talking about https://kivy.org/docs/installation/installation-osx.html#using-homebrew-with-pip, you need to follow these steps, to install kivy as python(pip) module.
Ya i have installed according to this link https://kivy.org/docs/installation/installation-osx.html#using-homebrew-with-pip but i have not done this step....
pip install https://github.com/kivy/kivy/archive/master.zip
ok let me try this step.:)
wow...that solved my issue...lots of love bro @manthansharma <3 <3
I still seem to be running into the same original issue after trying these suggestions. I've also tried updating Xcode's condo line tools, different versions of Cython, the development version of Kivy - all to no avail. Here's the traceback i get when the 'pip install kivy' command fails:
cythoning /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.pyx to /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c
Error compiling Cython file:
------------------------------------------------------------
...
end = time()
Logger.debug("Svg: Loaded {} in {:.2f}s".format(filename, end - start))
finally:
fd.close()
cdef void reload(self) except *:
^
------------------------------------------------------------
kivy/graphics/svg.pyx:469:9: Signature not compatible with previous declaration
Error compiling Cython file:
------------------------------------------------------------
...
cpdef flag_update(self, int do_parent=?, list _instrs=?)
ELSE:
cpdef flag_update(self, int do_parent=?)
cdef void flag_update_done(self)
cdef void set_parent(self, Instruction parent)
cdef void reload(self)
^
------------------------------------------------------------
kivy/graphics/instructions.pxd:36:20: Previous declaration is here
building 'kivy.graphics.svg' extension
/usr/bin/gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -arch i386 -arch x86_64 -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/include -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/include -I/Users/Matt/Development/projects/sandbox/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c -o build/temp.macosx-10.6-intel-3.6/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
1 error generated.
error: command '/usr/bin/gcc' failed with exit status 1
----------------------------------------
Command
"/Users/Matt/Development/projects/sandbox/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-umsx15w4-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/Matt/Development/projects/sandbox/.venv/include/site/python3.6/kivy" failed with error code 1 in /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/
Hi....I had got the same error that compiling was exiting with status
1....when I first tried to install kivy....
Jus a guess though have you used "easy install" to install the "pip"?
On 12-Oct-2017 7:27 AM, "MeIchthys" notifications@github.com wrote:
I still seem to be running into the same original issue after trying these
suggestions. I've also tried updating Xcode's condo line tools, different
versions of Cython, the development version of Kivy - all to no avail.
Here's the traceback i get when the 'pip install kivy' command fails:cythoning /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.pyx to /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c
Error compiling Cython file: ------------------------------------------------------------ ... end = time() Logger.debug("Svg: Loaded {} in {:.2f}s".format(filename, end - start)) finally: fd.close() cdef void reload(self) except *: ^ ------------------------------------------------------------ kivy/graphics/svg.pyx:469:9: Signature not compatible with previous declaration Error compiling Cython file: ------------------------------------------------------------ ... cpdef flag_update(self, int do_parent=?, list _instrs=?) ELSE: cpdef flag_update(self, int do_parent=?) cdef void flag_update_done(self) cdef void set_parent(self, Instruction parent) cdef void reload(self) ^ ------------------------------------------------------------ kivy/graphics/instructions.pxd:36:20: Previous declaration is here building 'kivy.graphics.svg' extension /usr/bin/gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -arch i386 -arch x86_64 -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/include -I/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/include -I/Users/Matt/Development/projects/sandbox/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c -o build/temp.macosx-10.6-intel-3.6/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/kivy/graphics/svg.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation. #error Do not use this file, it is the result of a failed Cython compilation. ^ 1 error generated. error: command '/usr/bin/gcc' failed with exit status 1 ----------------------------------------
Command
"/Users/Matt/Development/projects/sandbox/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-umsx15w4-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/Matt/Development/projects/sandbox/.venv/include/site/python3.6/kivy" failed with error code 1 in /private/var/folders/k5/8nmpgw7x1m5fmlpl9yygs6080000gn/T/pip-build-wfk4cxc4/kivy/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5400#issuecomment-335997794, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQqx0K7TdcwVBFMJxGuziCxZXuyclBN_ks5srXIUgaJpZM4PiJ0g
.
@gshanbhag525 I used pip that was pre-installed in my virtualenv to install Kivy. I’ve also tried it outside my virtualenv.
Take a look at this thread ...this guy seems to have used python 3... had
errors
Installed python 2.7 ....and there were no cython errors:)
On 12-Oct-2017 8:44 AM, "MeIchthys" notifications@github.com wrote:
@gshanbhag525 https://github.com/gshanbhag525 I used pip that was Oreo
stalked in my virtualenv to install Kivy. I’ve also tried it outside my
virtualenv.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5400#issuecomment-336008924, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQqx0Mq4SG4a0vUZRT7kQ9JcY4rBC2xSks5srYQegaJpZM4PiJ0g
.
Hey, @meichthys I think problem is with the compiler that has been used to install Python, b'coz python remember the compiler used and same compiler is used for further installation of module. So, you need to reinstall python with clang
. Checkout this link for more information: https://stackoverflow.com/a/18971260/5016321
@manthansharma hey buddy....i think you also own a Mac... I develop Android
apps using Android studio....can you give me some insight on building an
Android app using Kivy...
P.S. I have used Tkinter to create a desktop app.....now wanted to create
android app using same python script.... Don't have any idea about creating
it using Android studio so moved to Kivy:)
On 12-Oct-2017 1:40 PM, "Manthan Sharma" notifications@github.com wrote:
Hey, @meichthys https://github.com/meichthys I think problem is with the
compiler that has been used to install Python, b'coz python remember the
compiler used and same compiler is used for further installation of module.
So, you need to reinstall python with clang. Checkout this link for more
information: https://stackoverflow.com/a/18971260/5016321
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5400#issuecomment-336053928, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQqx0C0DX6bMKOKVeaHYDLTruziJW7G9ks5srcl6gaJpZM4PiJ0g
.
I Don't wanted to mess up the buildozer or python for Android
installation....if any one own a Mac and created an Android app using
Kivy....please help:)
On 12-Oct-2017 2:07 PM, "Gunesh Shanbhag" gshanbhag525@gmail.com wrote:
@manthansharma hey buddy....i think you also own a Mac... I develop
Android apps using Android studio....can you give me some insight on
building an Android app using Kivy...P.S. I have used Tkinter to create a desktop app.....now wanted to create
android app using same python script.... Don't have any idea about creating
it using Android studio so moved to Kivy:)On 12-Oct-2017 1:40 PM, "Manthan Sharma" notifications@github.com wrote:
Hey, @meichthys https://github.com/meichthys I think problem is with
the compiler that has been used to install Python, b'coz python remember
the compiler used and same compiler is used for further installation of
module. So, you need to reinstall python with clang. Checkout this link
for more information: https://stackoverflow.com/a/18971260/5016321—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5400#issuecomment-336053928, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQqx0C0DX6bMKOKVeaHYDLTruziJW7G9ks5srcl6gaJpZM4PiJ0g
.
@gshanbhag525 This issue will not be right place to discuss any other topic than installation. So if you ask on IRC or the mailing list: https://github.com/kivy/kivy#support, there you can find many insight of other kivy user and you can also pm me on IRC: freenode/@montem
Ok
On 12-Oct-2017 2:13 PM, "Manthan Sharma" notifications@github.com wrote:
@gshanbhag525 https://github.com/gshanbhag525 This issue will not be
right place to discuss any other topic than installation. So if you ask on
IRC or the mailing list: https://github.com/kivy/kivy#support, there you
can find many insight of other kivy user and you can also pm me on IRC:
freenode/@montem https://github.com/montem—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5400#issuecomment-336062225, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AQqx0LE1sdrXeZyIx_A7SRssIiTdDN8Zks5srdFOgaJpZM4PiJ0g
.
Thanks @manthansharma
I think that puts me on the right track. That stack overflow response should be a good starting point for me. I’ll play around and report back if I get things sorted out using clang.
I ended up clearing out all my different python installations and reinstalling python3 using home-brew. After that, i brew installed the kivy requirements, upgraded brew, and then pip installed cython==0.25.2 and then pip installed kivy. @manthansharma thanks for the tips. It was nice to clean up some old python installations i had floating around too. Now i have a clean install and kivy in my virtual env. cool!
Most helpful comment
wow...that solved my issue...lots of love bro @manthansharma <3 <3