Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95408 > unrolled thread

"no module named kivy" import error in ubuntu 14.04

Started byshiva upreti <katewinslet626@gmail.com>
First post2015-08-16 12:16 -0700
Last post2015-08-17 06:11 +0100
Articles 13 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  "no module named kivy" import error in ubuntu 14.04 shiva upreti <katewinslet626@gmail.com> - 2015-08-16 12:16 -0700
    Re: "no module named kivy" import error in ubuntu 14.04 MRAB <python@mrabarnett.plus.com> - 2015-08-16 20:27 +0100
    Re: "no module named kivy" import error in ubuntu 14.04 Laura Creighton <lac@openend.se> - 2015-08-16 21:58 +0200
    Re: "no module named kivy" import error in ubuntu 14.04 Chris Angelico <rosuav@gmail.com> - 2015-08-17 11:47 +1000
      Re: "no module named kivy" import error in ubuntu 14.04 Rustom Mody <rustompmody@gmail.com> - 2015-08-16 19:51 -0700
        Re: "no module named kivy" import error in ubuntu 14.04 Chris Angelico <rosuav@gmail.com> - 2015-08-17 12:59 +1000
      Re: "no module named kivy" import error in ubuntu 14.04 rurpy@yahoo.com - 2015-08-16 20:19 -0700
        Re: "no module named kivy" import error in ubuntu 14.04 Laura Creighton <lac@openend.se> - 2015-08-17 06:14 +0200
          Re: "no module named kivy" import error in ubuntu 14.04 rurpy@yahoo.com - 2015-08-16 22:05 -0700
            Re: "no module named kivy" import error in ubuntu 14.04 Laura Creighton <lac@openend.se> - 2015-08-17 09:52 +0200
              Re: "no module named kivy" import error in ubuntu 14.04 rurpy@yahoo.com - 2015-08-17 16:35 -0700
            Re: "no module named kivy" import error in ubuntu 14.04 Rustom Mody <rustompmody@gmail.com> - 2015-08-17 10:13 -0700
    Re: "no module named kivy" import error in ubuntu 14.04 Dave Farrance <df@see.replyto.invalid> - 2015-08-17 06:11 +0100

#95408 — "no module named kivy" import error in ubuntu 14.04

Fromshiva upreti <katewinslet626@gmail.com>
Date2015-08-16 12:16 -0700
Subject"no module named kivy" import error in ubuntu 14.04
Message-ID<bf6602db-8a67-46e4-b02c-94cd462081f0@googlegroups.com>
Hi
I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder. But it showed the error "no module named cython". Then I tried installing cython, it installed successfully but the command "python setup.py" still gave the error "no module named cython".
Finally I installed kivy using instructions on this video: https://www.youtube.com/watch?v=mypVFCIIZtw. Now when i try to run the following commands:

"$ cd <path to kivy-examples> (I used the actual path, i.e., "/usr/share/kivy-examples")
 $ cd demo/touchtracer
 $ python main.py"
I am still getting the error:"ImportError: No module named kivy".

Any help will be highly appreciated.
Thanks.

[toc] | [next] | [standalone]


#95409

FromMRAB <python@mrabarnett.plus.com>
Date2015-08-16 20:27 +0100
Message-ID<mailman.42.1439753242.4764.python-list@python.org>
In reply to#95408
On 2015-08-16 20:16, shiva upreti wrote:
> Hi
> I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder. But it showed the error "no module named cython". Then I tried installing cython, it installed successfully but the command "python setup.py" still gave the error "no module named cython".
> Finally I installed kivy using instructions on this video: https://www.youtube.com/watch?v=mypVFCIIZtw. Now when i try to run the following commands:
>
> "$ cd <path to kivy-examples> (I used the actual path, i.e., "/usr/share/kivy-examples")
>   $ cd demo/touchtracer
>   $ python main.py"
> I am still getting the error:"ImportError: No module named kivy".
>
> Any help will be highly appreciated.
> Thanks.
>
Do you know which Python they were installed into? Was it the system
Python (you should probably leave that one alone) or the one that you
installed? And which one is it trying to run?

[toc] | [prev] | [next] | [standalone]


#95414

FromLaura Creighton <lac@openend.se>
Date2015-08-16 21:58 +0200
Message-ID<mailman.44.1439755132.4764.python-list@python.org>
In reply to#95408
In a message of Sun, 16 Aug 2015 12:16:53 -0700, shiva upreti writes:
>I am still getting the error:"ImportError: No module named kivy".
>
>Any help will be highly appreciated.
>Thanks.

The  preferred way to install kivy with ubuntu is to follow the
instructions here:
http://kivy.org/docs/installation/installation-linux.html

i.e. $ sudo apt-get install python3-kivy
     $ sudo apt-get install kivy-examples

This assumes you want to use Python 3.

See if this works,  write back if it doesn't.

Laura

[toc] | [prev] | [next] | [standalone]


#95419

FromChris Angelico <rosuav@gmail.com>
Date2015-08-17 11:47 +1000
Message-ID<mailman.48.1439776065.4764.python-list@python.org>
In reply to#95408
On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti <katewinslet626@gmail.com> wrote:
> I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder.

As Laura said, the preferred way to install under Ubuntu would be to
use apt-get. But if you want to install directly from PyPI, the best
way is to use pip. Those are two package managers, which remove from
you the hassle of hunting down all the different dependencies, like
Cython. Try apt-get first, and if that doesn't do what you're looking
for, use pip (maybe inside a virtualenv). It'll chug for a while and
then give you what you need.

ChrisA

[toc] | [prev] | [next] | [standalone]


#95421

FromRustom Mody <rustompmody@gmail.com>
Date2015-08-16 19:51 -0700
Message-ID<bbe9b6b8-7084-482f-a9e4-61e690393311@googlegroups.com>
In reply to#95419
On Monday, August 17, 2015 at 7:30:14 AM UTC+5:30, Chris Angelico wrote:
> On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti wrote:
> > I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder.
> 
> As Laura said, the preferred way to install under Ubuntu would be to
> use apt-get. But if you want to install directly from PyPI, the best
> way is to use pip. Those are two package managers, which remove from
> you the hassle of hunting down all the different dependencies, like
> Cython. Try apt-get first, and if that doesn't do what you're looking
> for, use pip (maybe inside a virtualenv). It'll chug for a while and
> then give you what you need.

Its not vanilla apt-get but ppa-apt-get (as Laura's link indicates)

[toc] | [prev] | [next] | [standalone]


#95422

FromChris Angelico <rosuav@gmail.com>
Date2015-08-17 12:59 +1000
Message-ID<mailman.50.1439780388.4764.python-list@python.org>
In reply to#95421
On Mon, Aug 17, 2015 at 12:51 PM, Rustom Mody <rustompmody@gmail.com> wrote:
> On Monday, August 17, 2015 at 7:30:14 AM UTC+5:30, Chris Angelico wrote:
>> On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti wrote:
>> > I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder.
>>
>> As Laura said, the preferred way to install under Ubuntu would be to
>> use apt-get. But if you want to install directly from PyPI, the best
>> way is to use pip. Those are two package managers, which remove from
>> you the hassle of hunting down all the different dependencies, like
>> Cython. Try apt-get first, and if that doesn't do what you're looking
>> for, use pip (maybe inside a virtualenv). It'll chug for a while and
>> then give you what you need.
>
> Its not vanilla apt-get but ppa-apt-get (as Laura's link indicates)

I didn't actually click the link. But it's still apt-get, just with an
additional repository. In any case, it's way better to use a package
manager (either system-provided or Python-provided) than to do
everything manually.

ChrisA

[toc] | [prev] | [next] | [standalone]


#95423

Fromrurpy@yahoo.com
Date2015-08-16 20:19 -0700
Message-ID<22e8c1bc-72ba-46e1-9402-fbd1bd893a35@googlegroups.com>
In reply to#95419
On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote:
> On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti <katewinslet626@gmail.com> wrote:
> > I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder.
> 
>[...] 
> use pip (maybe inside a virtualenv). It'll chug for a while and
> then give you what you need.

Umm, actually no...

| ~# pip3 install kivy
| Downloading/unpacking kivy
|   Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded
|   Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy
|     Traceback (most recent call last):
|       File "<string>", line 17, in <module>
|       File "/tmp/pip-build-m40337r5/kivy/setup.py", line 173, in <module>
|         from Cython.Distutils import build_ext
|    ImportError: No module named 'Cython'    
|     Cython is missing, its required for compiling kivy !
    
(on Fedora-21 where no kivy repo package is available)

[toc] | [prev] | [next] | [standalone]


#95424

FromLaura Creighton <lac@openend.se>
Date2015-08-17 06:14 +0200
Message-ID<mailman.51.1439784857.4764.python-list@python.org>
In reply to#95423
In a message of Sun, 16 Aug 2015 20:19:49 -0700, rurpy--- via Python-list write
s:
>On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote:
>> On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti <katewinslet626@gmail.com> wrote:
>> > I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10 (I think python3 was already installed in ubuntu 14.04). Then i downloaded kivy from https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it and tried to execute "python setup.py" inside the kivy folder.
>> 
>>[...] 
>> use pip (maybe inside a virtualenv). It'll chug for a while and
>> then give you what you need.
>
>Umm, actually no...
>
>| ~# pip3 install kivy
>| Downloading/unpacking kivy
>|   Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded
>|   Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy
>|     Traceback (most recent call last):
>|       File "<string>", line 17, in <module>
>|       File "/tmp/pip-build-m40337r5/kivy/setup.py", line 173, in <module>
>|         from Cython.Distutils import build_ext
>|    ImportError: No module named 'Cython'    
>|     Cython is missing, its required for compiling kivy !
>    
>(on Fedora-21 where no kivy repo package is available)
>-- 
>https://mail.python.org/mailman/listinfo/python-list

If you scroll down
http://kivy.org/docs/installation/installation-linux.html

there are instructions for Fedora as well.

Laura

[toc] | [prev] | [next] | [standalone]


#95425

Fromrurpy@yahoo.com
Date2015-08-16 22:05 -0700
Message-ID<7054434a-03fd-46d9-b0a9-850748167376@googlegroups.com>
In reply to#95424
On Sunday, August 16, 2015 at 10:14:29 PM UTC-6, Laura Creighton wrote:
> In a message of Sun, 16 Aug 2015 20:19:49 -0700, rurpy--- via Python-list writes:
> >On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote:
> >>[...] 
> >> use pip (maybe inside a virtualenv). It'll chug for a while and
> >> then give you what you need.
> >
> >Umm, actually no...
> >
> >| ~# pip3 install kivy
> >| Downloading/unpacking kivy
> >|   Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded
> >|   Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for package kivy
> >|     Traceback (most recent call last):
> >|       File "<string>", line 17, in <module>
> >|       File "/tmp/pip-build-m40337r5/kivy/setup.py", line 173, in <module>
> >|         from Cython.Distutils import build_ext
> >|    ImportError: No module named 'Cython'    
> >|     Cython is missing, its required for compiling kivy !
> >    
> >(on Fedora-21 where no kivy repo package is available)
> >-- 
> >https://mail.python.org/mailman/listinfo/python-list
> 
> If you scroll down
> http://kivy.org/docs/installation/installation-linux.html
> 
> there are instructions for Fedora as well.

Thanks.  But I note that those are all for very old, EoL'd versions
of Fedora.

I manually installed cython with pip, but then the kivy install
failed with some C errors.  At the top of it's multi-thousand line
log output was a warning that it requires cython-0.21.2.  Pip had 
installed cython-0.23.  I installed cython-0.21.2 (since I do not 
use cython for anything else and noting that pip did not bother 
to inform me it was overwriting an existing install) and then pip 
installed kivy without error.  However there were a number of 
warning message about missing somethings (libs or python packages, 
was not clear to me).

So I eventually found the kivy docs on their website where they
list prerequisite packages for installing kivy on ubuntu.  I'll 
translate those to hopefully the equivalent fedora package names, 
install them, reinstall kivy, and get a working kivy install.

The point here that all the above is a LONG way from what was
was posted here: "just type 'pip install kivy' and pip will take 
care of everything".

I hope someday Python gets a decent packaging/distribution story.

[toc] | [prev] | [next] | [standalone]


#95428

FromLaura Creighton <lac@openend.se>
Date2015-08-17 09:52 +0200
Message-ID<mailman.53.1439797952.4764.python-list@python.org>
In reply to#95425
In a message of Sun, 16 Aug 2015 22:05:29 -0700, rurpy--- via Python-list write
s:
>So I eventually found the kivy docs on their website where they
>list prerequisite packages for installing kivy on ubuntu.  I'll 
>translate those to hopefully the equivalent fedora package names, 
>install them, reinstall kivy, and get a working kivy install.
>
>The point here that all the above is a LONG way from what was
>was posted here: "just type 'pip install kivy' and pip will take 
>care of everything".
>
>I hope someday Python gets a decent packaging/distribution story.

Can you post what one should do with modern Fedora distributions, so
we can tell the kivy-devs and they can update that webpage?

Laura

[toc] | [prev] | [next] | [standalone]


#95452

Fromrurpy@yahoo.com
Date2015-08-17 16:35 -0700
Message-ID<ed9f070f-cd82-4bc2-8df9-f608dd977bc7@googlegroups.com>
In reply to#95428
On 08/17/2015 01:52 AM, Laura Creighton wrote:
> In a message of Sun, 16 Aug 2015 22:05:29 -0700, rurpy--- via Python-list writes:
>> So I eventually found the kivy docs on their website where they
>> list prerequisite packages for installing kivy on ubuntu.  I'll 
>> translate those to hopefully the equivalent fedora package names, 
>> install them, reinstall kivy, and get a working kivy install.

Actually, right after I posted, I saw a Fedora-specific list of
packages on the kivy website. However, after I installed them
and reinstalled kivy I still got the same set of missing package
warning that I got before.
And hoping that the packages just enabled optional features I
tried running the simple "hello-world" program from their website.
It died horribly:

| [CRITICAL] [Window ] Unable to find any valuable Window provider at all!
| egl_rpi - ImportError: cannot import name 'bcm'
| File "/usr/lib64/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
and
| x11 - ImportError: No module named 'kivy.core.window.window_x11'
| File "/usr/lib64/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
| fromlist=[modulename], level=0)
| [CRITICAL] [App ] Unable to get a Window, abort.

>> The point here that all the above is a LONG way from what was
>> was posted here: "just type 'pip install kivy' and pip will take 
>> care of everything".
>>
>> I hope someday Python gets a decent packaging/distribution story.
> 
> Can you post what one should do with modern Fedora distributions, so
> we can tell the kivy-devs and they can update that webpage?

Unfortunately I have no idea what one should do. The standard response
in this group is that pip knows, hence I don't need to. I just wanted
to point out the fallacy of that.

[toc] | [prev] | [next] | [standalone]


#95440

FromRustom Mody <rustompmody@gmail.com>
Date2015-08-17 10:13 -0700
Message-ID<740eebef-a359-4a8f-9c5c-4d43cb2e75b3@googlegroups.com>
In reply to#95425
On Monday, August 17, 2015 at 10:35:48 AM UTC+5:30, rurpy wrote:
> I hope someday Python gets a decent packaging/distribution story.

You are in august company

| The final question was about what he (Guido) hates in Python. "Anything to do
| with package distribution", he answered immediately. There are problems
| with version skew and dependencies that just make for an "endless
| mess". He dreads it when a colleague comes to him with a "simple Python
| question". Half the time it is some kind of import path problem and
| there is no easy solution to offer.

From https://mail.python.org/pipermail/python-list/2015-July/694818.html
Quoting https://lwn.net/Articles/651967/

[toc] | [prev] | [next] | [standalone]


#95426

FromDave Farrance <df@see.replyto.invalid>
Date2015-08-17 06:11 +0100
Message-ID<7mo2ta17psvpc1c7iqhb4hsqvi2gme9hhs@4ax.com>
In reply to#95408
shiva upreti <katewinslet626@gmail.com> wrote:

>Hi
>I am new to linux. I tried various things in attempt to install kivy. I installed python 2.7.10

Just to make clear what others have said -- replacing Ubuntu 14.04's
system Python 2.7.6 is a bad idea and will break stuff, so if you really
must have the latest version of Python2, then you install it separately,
leaving the system Python in place. That in turn means that you can no
longer use Ubuntu's normal method of installing libraries via its own
software management.

> Then i downloaded kivy from
> https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz

I suggest that you DON'T install from tarfiles unless your understanding
of Python is of near python-developer level. You really need to know
what you're doing regarding dependencies and the search path for
modules.

If you do want to install a separate instance of the latest version of
Python, then the PIP package management is best, and use it to install
the libraries separately, NOT in the /usr/ directory -- see the other
posts. 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web