Forums

Select Python Console when running file

I have a file that I want to run, but from what I can tell it always defaults to running Python 3.4. I have kivy installed and it seems to be functional in 2.7 (but not in 3.4), but I can't seem to find a way to select a specific version of Python to use. Can you point me in the right direction?

If you add this to the very start of your file, it will run using Python 2.7:

#!/usr/local/bin/python2.7

I tried running a similar command from the shell with no luck, but that worked great. Thanks!

Now that the file is running in the correct version of python, its throwing a critical error - unable to get a window, abort. Its a very simple kivy interface that should open a window with a couple buttons and a slider. This same code runs great on the computer, is there something specific I need to create a window in python anywhere?

Ah, I don't think that's going to work. PythonAnywhere is a server environment -- that means the code runs on our servers, so it has no access to the GUI on your own PC. It's a text-only world I'm afraid (apart from web apps).

Poop. Thanks for helping me out!

Hi, Unable to run the chromedriver.exe in my python script.

See our help page about using selenium on PythonAnywhere: http://help.pythonanywhere.com/pages/selenium/