简体   繁体   中英

How do I install Kivy with Python 3.4 on Windows 8.1?

So I have been pulling my hair out trying to figure out how to do this. I have Cython and Pygame installed, (Or at least Visual Studio says so.) but everytime I run setup.py it says I don't have Cython.

I have tried to use Wheel, but it keeps giving errors and not installing. Here is the error:

Installing 'C:\Users\paolo\Downloads\Kivy‑1.9.0‑cp34‑none‑win32.whl'
You are using pip version 6.0.8, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 305, in run
    name, None, isolated=options.isolated_mode,
  File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 164, in from_line
    wheel = Wheel(link.filename)  # can raise InvalidWheelFilename
  File "C:\Python34\lib\site-packages\pip\wheel.py", line 504, in __init__
    "%s is not a valid wheel filename." % filename
pip.exceptions.InvalidWheelFilename: Kivy\u20111.9.0\u2011cp34\u2011none\u2011win32.whl is not a valid wheel filename.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\logging\__init__.py", line 980, in emit
    stream.write(msg)
  File "C:\Python34\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 133, in write
    self.write_and_convert(text)
  File "C:\Python34\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 161, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Python34\lib\site-packages\pip\_vendor\colorama\ansitowin32.py", line 166, in write_plain_text
    self.wrapped.write(text[start:end])
  File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2011' in position 4: character maps to <undefined>
Call stack:
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\lib\site-packages\pip\__main__.py", line 19, in <module>
    sys.exit(pip.main())
  File "C:\Python34\lib\site-packages\pip\__init__.py", line 217, in main
    return command.main(cmd_args)
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 243, in main
    logger.critical(str(exc))
Message: 'Kivy\u20111.9.0\u2011cp34\u2011none\u2011win32.whl is not a valid wheel filename.'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 305, in run
    name, None, isolated=options.isolated_mode,
  File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 164, in from_line
    wheel = Wheel(link.filename)  # can raise InvalidWheelFilename
  File "C:\Python34\lib\site-packages\pip\wheel.py", line 504, in __init__
    "%s is not a valid wheel filename." % filename
pip.exceptions.InvalidWheelFilename: Kivy\u20111.9.0\u2011cp34\u2011none\u2011win32.whl is not a valid wheel filename.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\logging\__init__.py", line 980, in emit
    stream.write(msg)
  File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2011' in position 4: character maps to <undefined>
Call stack:
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\lib\site-packages\pip\__main__.py", line 19, in <module>
    sys.exit(pip.main())
  File "C:\Python34\lib\site-packages\pip\__init__.py", line 217, in main
    return command.main(cmd_args)
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 243, in main
    logger.critical(str(exc))
Message: 'Kivy\u20111.9.0\u2011cp34\u2011none\u2011win32.whl is not a valid wheel filename.'
Arguments: ()
'C:\Users\paolo\Downloads\Kivy‑1.9.0‑cp34‑none‑win32.whl' failed to install. Exit code: 1

I have no clue how to install it. Any help is appreciated.

I used the "all inclusive" Kivy-1.9.0-py3.4-win32-x64.exe and that installed without any issue on win8.1.

To get an IDE I installed the community version of PyCharm, which also worked out of the box with kivy in my case.

All in all I have ended up with 3 different py3 installations instead of trying to get obscure dependencies/links working for different packages.

It seems to work well and does not seem to interfere with for example my Anaconda installation that I had earlier and am still using as well.

The bat-file trick to launch .py kivy files was also possible to make work on my computer (on the first shot).

Maybe that's the easiest way to get things up and running (unless you absolutely want to solve installation as add-on in your particular case...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM