Google App Engine Launcher not completing loading - python-2.7

Good day all. First time stack overflow has not previously answered an issue that I have. My problem is exactly like the one posted here, except I am running windows:
Google App Engine Launcher is not running my hello world for Python Mac
The only thing the log gives me is this
2016-08-18 13:39:13 Running command:
"['C:\Users\Kesi\Desktop\Documents\Computer
Science\Udacity\Intro to backend\hello-udacity\main.py',
'C:\Program Files (x86)\Google\google_appengine\dev_appserver.py',
'--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000',
'C:\Users\Kesi\Desktop\Documents\Computer Science\Udacity\Intro
to backend\hello-udacity']"
Any suggestions are greatly appreciated.

Converting comments to an answer.
The 1st argument in the command list from your message is 'C:\Users\Kesi\Desktop\Documents\Computer Science\Udacity\Intro to backend\hello-udacity\main.py', preceeding the dev_appserver.py suggests a configuration problem.
In the google app engine preferences section there is a place to specify the path to executable python file. That should not be set to your app's python file (as you have it), but to the actual python executable (from your python installation) - which executes dev_appserver.py (the 2nd arg in the command list) which in turn loads the subsequent command list args including one which is the one specifying your app code's location - the last one in your case.
The python executable could be a python.exe or pythonw.exe according to the Executing scripts section of Using Python on Windows doc:
Python scripts (files with the extension .py) will be executed by
python.exe by default. This executable opens a terminal, which stays open even if the program uses a GUI. If you do not want this to
happen, use the extension .pyw which will cause the script to be
executed by pythonw.exe by default (both executables are located
in the top-level of your Python installation directory). This
suppresses the terminal window on startup.

Related

Pycharm background tasks taking forever

I am new to pycharm and I am having trouble to run a simple file which is just to import pandas. I am having following issues:
Whenever, I open the project, "Scanning files to index" takes
forever.
I can see that in indexing, it is using packages/files from
Anaconda2 and that is why it takes forever for my program to run.
I have already tried to make certain folder "Excluded" as described here PyCharm 4.0.5 hangs on 'scanning files to index' background task
I have also deleted the "Caches" folder as described here Intelli J IDEA takes forever to update indices
Pycharm Layout
Pycharm indexes your python environment as well as your project folders. This is normal when first changing either of these. If it occurs more frequently:
View the end of the log that #Pavel mentioned in Help | Show Log in Explorer.
Replicate the command that is stalling the scan and fix any errors.
In my case the package scanning stalled with a vague [y/N] as shown
here. Searching the log I found the following conda.exe command:
Command line: C:\Users\<User>\anaconda3\Scripts\conda.exe list -p C:/Users/<User>/anaconda3/envs/py38 -e
Running this on the command line gave me a more detailed description of my environment error and how to fix it.

python not accessible in powershell v3 when opened with Popen

Hopefully this should be simple. Python environment is running fine if I open PowerShell v3 manually. I can check version and run external scripts etc. But as soon as I open powershell.exe through subprocess.Popen from a python script from another application, python simply won't run; "The term 'Python' is not recognised as the name of a cmdlet, function, script file or operable program... etc"
I've checked my environment paths repeatedly and python is running fine on the system in general.
anyone has any idea what this could be caused by?
subprocess.Popen(["powershell.exe", '-ExecutionPolicy', 'RemoteSigned', "path to PS1_script_with python command"])
My PS1 file looks like this:
cd C:\Users\David\Geeknote\geeknote-master\geeknote
python gnsync.py --path "C:\Users\David\Desktop\C4DtoEvernote", --mask "*.nfo", --notebook "Python Logs"
function Pause{Read-Host 'You have successfully synced your C4D Annotations to Evernote using gnsync.
Please press Enter to continue...' | Out-Null}
Pause{}
It seems (for whatever reason) your $PATH is not being read or honored by the process; and thus python cannot be found.
You can either:
Set up the path with $env:Path = "C:\Python27:C:\Python27\Scripts";
Setup the path using a custom console profile (ie, a .ps1 file) and passing it with -PSConsoleFile.
The simplest option, pass the full path to the Python executable in your command file C:\Python27\python.exe gsync.py ...
I would try #3, and then see if you need the other options.
Adjust the paths as appropriate - especially if you have multiple Python interpreters installed.

Minko error building SDK

I am trying to compile the Minko framework on Windows 10 targeted at HTML. However, I'm hitting an error running the build_html5.bat script.
I've followed the instructions and completed all the steps (except for moving from the main branch to the dev branch, which is listed as optional). I cloned the source, set the new Environment Variable, ran the install_emscripten.bat file, and ran the specified commands in the emscripten command prompt.
However, when I try to run the build_html5.bat script, I get the following error:
I've looked in the MINKO_HOME directory and was able to find the jsoncpp.cpp file, but the jsoncpp.o file is not where in the directory specified in the command being called. The only file in MINKO_HOME/framework/obj/html5/release is a file named 'linker.rsp'.
I tried pulling down the dev branch into a different directory and updating the MINKO_HOME variable accordingly. I couldn't find the tool directory, but I was able to run the script scripts/solution_gmake_full.bat, after my first error trying to run build_html5_full.bat. When trying to run build_html5_full.bat, however, I get a different error:
Am I missing something here? Any help would be appreciated!
Sincerely,
Alex

Python script.py once saved now won't load as before

I have just started looking & learning Python (on Ubuntu 14.04) using the website: http://learnpythonthehardway.org/book/ and http://www.codecademy.com/
Yesterday, I worked for an hour on a few scripts namely 1-4 and named them as ex1.py etc and they executed fine. Today, I have come back to carry on with a few more exercises and tested my first exercises only to find now I get "SyntaxError: invalid syntax" when attempting "python ex1.py" with or without .py I have tried "#!/usr/bin/python" in any script header also. The path/Dir I have been using to test my Python scripts in is simply 'Python' within my Home Dir. I checked the actual file permissions but that appears to make no difference.
I am not too sure if it's an OS setup issue; Python issue; or simply me. Python seems great, so any ideas on what I'm doing wrong? What has changed since yesterday to my python.py script files?
The problem is that you are in the Python interpreter, and not the Linux terminal. This is indicated both by the error messages you saw and by the >>> prompt.
Exit the interpreter by holding down control and pressing the D key. You will then be back in the Linux terminal and running a script will work the way you expect it to.

How do I run my Python program that I wrote?

I am trying to run my celcius.py file but I don't know what to type in the command line...
When I type Python celcius.py it does not work:
I get the following message:
>>> python celcius.py
File "<stdin>", line 1
python celcius.py
^
SyntaxError: invalid syntax
>>>
When I open it the program with the Python IDLE GUI it runs the program and closes the program before I can see it. I read somewhere that it won't close if you run it from the command line.
You need to type "python celsius.py" in the windows command prompt, rather than the Python command prompt; this only works straight away if the Python directory is in your PATH. It probably isn't, so you need to use this instead: C:\Python27\python.exe celsius.py.
Because celsius for you is in the same folder as python, you can do this as well:
CD C:\Python27
python.exe celsius.py
In general, change the directory (CD) to where your file is stored, then run C:\Python27\python.exe <filename>
Double-clicking is generally easier in Windows, though, assuming it is set up to do that (it normally is unless you change it back)
There are a few ways of doing this.
WAY 1
step one: Open command prompt (go to start and type in "cmd") *NOTE: do NOT open python. if you see ">>>" in your command prompt window you opened python. This is bad.
step two: type in this: python "path\to\file\celcius.py" replacing path\to\file with the path (starting with the name of the folder that you're computer user is named. So for my computer that would be ben. So let's say my celcius.py is located on the desktop I would run python "Desktop\celcius.py" and hit <.enter.>. It looks like you have celcius.py in your python folder. Don't put it there. that's the system files for python itself. move it to your desktop or your documents folder. By the way, if you have truble using this, make sure you're system is set up to execute the python command. Go here for reference.
WAY 2
assuming you have python associated with the .py file in explorer, you can find the file and double-click on it.
WAY 3
open IDLE (you can usually find it in your list of programs in start). Open the python file through IDLE. This will show you the source code for your program. hit <.F5.>. F5 will execute the program from within the the IDLE shell.
You don't need to do this, just open the command prompt and type:
python path/to/your/file.py
Just make sure that python command is set in your environment PATH, check this