0

At first I did all of the pip installations for kivy and everything on command prompt said it was successful. Then I realized when kivy wasnt working that python wasnt on path. Then I added it to user variables path using three different paths because I didnt know which one to use.

1 C:\Windows;C:\Windows\System32;C:\Python27

2 "C:\Python27"

3 "C:\Python27\scripts"

Now when I go into the command prompt and try to install pip and all of the kivy installations it just says invalid syntax and when I do "python --version" in command prompt it also says that. I am really over my head here. I am completely lost. What do I do?

I am sure I am in command prompt and not a python interpreter / shell.

When I run as administrator nothing different happens. Still says invalid syntax.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • Are you by any chance running those commands inside the Python interpreter (a prompt like `>>>`) instead of the Windows command line shell (a prompt like `C:\>`)? – abarnert Mar 29 '18 at 20:45
  • @JoshGimenes: Open a new command prompt window and run it under Administrator. – ikolim Mar 29 '18 at 20:50
  • I am sure I am in command prompt and not a python interpreter / shell. When I run as administrator nothing different happens. Still says invalid syntax. – Josh Gimenes Mar 29 '18 at 21:11
  • @JoshGimenes: Please try *python -c 'import sys; print(sys.version)'* at Command Prompt. – ikolim Mar 29 '18 at 21:24
  • when I do that it says syntax error: EOL while scanning string literal – Josh Gimenes Mar 29 '18 at 21:32
  • @JoshGimenes: If Python was installed and the path setup successfully, typing *python* on your command prompt will fire up the Python interpreter. – ikolim Mar 29 '18 at 21:35
  • Yes when I type in Python it lets me type in python code. That works. – Josh Gimenes Mar 29 '18 at 21:37
  • Now when I type in command prompt all of the installation commands for kivy it says that they are satisfied but when I try to run the test command it says no such file or directory – Josh Gimenes Mar 29 '18 at 21:40
  • @JoshGimenes: Could you please provide us the *test command*? – ikolim Mar 29 '18 at 21:47
  • @ikolim python share\kivy-examples\demo\showcase\main.py Also I got kivy to work in the normal python but it doesnt work in pycharm. Do you know I can make it work in pycharm? I tried everything in kivy's tutorial. – Josh Gimenes Mar 29 '18 at 21:49
  • @JoshGimenes: Please check whether *kivy-examples* are in folder, *C:\Python27*. In *PyCharm*, you have setup the Python Interpreter in [Settings](https://stackoverflow.com/questions/49466785/kivy-error-python-2-7-sdl2-import-error/49477111#49477111) – ikolim Mar 29 '18 at 22:02
  • @ikolim I did not set up any interpreters and it is using the default one I guess. I don't have a python27 folder in my C:\ directory. – Josh Gimenes Mar 29 '18 at 22:03
  • @JoshGimenes: The *kivy-examples* are installed in your Python folder. – ikolim Mar 29 '18 at 22:17
  • @ikolim ok but what does that have to do with kivy not working in pycharm? – Josh Gimenes Mar 29 '18 at 22:32
  • @JoshGimenes: The answer is as shown in the screen print in my post. – ikolim Mar 29 '18 at 22:52
  • @ikolim I don't think my Python was installed to C:\Python27. When I go in my C:\ folder, there is no Python27 folder. – Josh Gimenes Mar 30 '18 at 00:12

1 Answers1

0

Windows 10

Python Installation Location

Please change usr with your user id.

C:\Users\usr\AppData\Local\Programs\Python\Python35

Kivy Installation Location

C:\Users\usr\AppData\Local\Programs\Python\Python35\Lib\site-packages\kivy

PyCharm Settings > Project Interpreter

In PyCharm, you have to setup the Project Interpreter in Settings in order to get Kivy working i.e. import kivy, etc. The Python folder contains the Kivy installation as shown in the screen shot below.

Please refer to PyCharm Project Interpreter Setup

Img01 enter image description here

ikolim
  • 15,721
  • 2
  • 19
  • 29
  • @JoshGimenes: In your computer, Python is installed at *C:\Users\harry\AppData\Local\Programs\Python\Python36*. Kivy is installed at *C:\Users\harry\AppData\Local\Programs\Python\Python36\Lib\site-packages\kivy* – ikolim Mar 30 '18 at 00:53
  • Using this information, how do I make kivy work in pycharm? – Josh Gimenes Mar 30 '18 at 00:58