I see the following error in the log file:
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyc", line 486, in __bootstrap_inner
File "launcher\taskthread.pyc", line 65, in run
File "subprocess.pyc", line 594, in __init__
File "subprocess.pyc", line 816, in _execute_child
WindowsError: [Error 5] Access is denied
WindowsError: [Error 5] Access is denied
In Windows I used to see this error myself after installing Google App Engine SDK for PHP. This error occured when gae could not find the PHP executable.
The thing was I was specifying the absolute path to the folder that contained php-cgi.exe, leaving out the name of the executable php-cgi.exe! I solved this problem by adding the name of tyhe executable as well. So you might want to take a look again at your absolute path and make corrections.
from the docs:
Start the web server with the following command, giving it the path to
your project directory:
google_appengine/dev_appserver.py --php_executable_path=absolute-path-to-php-cgi.exe myproject/
Hope it helps,
Related
I'm trying to run a python script when the system boots on a Windows 10 workstation. My python script runs fine when I kick it off in a different directory as a user with administrative privileges but when I run it from a bat file in the C:\Windows\System32\GroupPolicy\Machine\Scripts\Startup folder on system boot I receive the following error in my logs.
2018-11-13 04:43:58,913 - VP - Level 55 - nmap args: ['"C:\\Program Files (x86)\\Nmap\\nmap.exe"', '-oX', 'C:\\\\nmap\\NmapResults\\scan-192.168.1.5-20181113044358.xml', '-sS', '-n', '-p-', '--allports', '--scan-delay', '1ms', '-sU', '-sV', '--version-all', '192.168.1.5']
Traceback (most recent call last):
File "secnmap\nmap_scanner.py", line 596, in <module>
exit_code = main()
File "secnmap\nmap_scanner.py", line 248, in main
run_nmap(args, scan_options, host_data_list, use_service_name_check)
File "secnmap\nmap_scanner.py", line 268, in run_nmap
nmap_proc = subprocess.Popen(nmap_cmd_list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 5] Access is denied
Here is the content of the .bat file.
cd C:\\nmap_startup
python nmap_startup.py
I have tried using the full nmap.exe path as shown in the code snippet as well as plain old nmap. I get the access denied error either way. I didn't see much in subprocess.py that would lead me to believe this to be an error with the python code either so I am leaning on it being an issue with System user running the script. If someone thinks otherwise or has any ideas, I'd love to hear them. Thanks
EDIT: I chose to run from a bat file because my python version is 32bit and I was having issues running from the C:\windows\system32 directory
It turns out that the path to nmap, C:\Program Files (x86)\Nmap, was not included in the system environment variables. When the script ran as a System user, it did not recognize the location of nmap
I dont have much experience in python, so it might be a stupid question.
Im trying to write to a file in my script, if I run the script from his folder, it works, however if I run it from another folder, I have an error 13 persmission denied
i.e. in cmd :
cd C:\Users\user010\Perforce\Build\LS3\
py Build_jenkins.py
works but
cd C:\Program Files (x86)\Jenkins\workspace\LC3.3 Test\Qt\main
py C:\Users\user010\Perforce\Build\LS3\Build_jenkins.py
doesnt work. I have tried moving the script and the file to a public folder, same error :
Traceback (most recent call last):
File "C:\Users\Public\Documents\Build\LS3\Build_jenkins.py", line 159, in <module>
Variables.Sauvegarder()
File "C:/Users/Public/Documents/Build/LS3/../Common\Variables.py", line 87, in Sauvegarder
gArbre.write( NOM_FICHIER )
File "C:\Python34\lib\xml\etree\ElementTree.py", line 761, in write
with _get_writer(file_or_filename, encoding) as write:
File "C:\Python34\lib\contextlib.py", line 59, in __enter__
return next(self.gen)
File "C:\Python34\lib\xml\etree\ElementTree.py", line 798, in _get_writer
errors="xmlcharrefreplace")
PermissionError: [Errno 13] Permission denied: 'Variables.xml'
The code is Variables.Sauvegarder() in my main file and in Variables :
import xml.etree.ElementTree as ET
gArbre = ET.parse( "Variables.xml" )
def Sauvegarder():
gArbre.write( "Variables.xml")
Edit : important detail I forgot to mention, the file im writing to is located in the script folder (C:/Users/Public/Documents/Build/LS3/../Common\Variables.xml)
To be honest, I'm not sure about Windows computers (for a mac or other linux-based system you'd use sudo), but I would recommend trying to run the command as an administrator (use the runas command plus the name of an account with admin priveledges.) That should hopefully fix the error you're getting.
I have checked out a folder from SVN to my desktop. Actually I need to extract the information like SVN revision no, URL and status for the specific file in the local working copy. Here is the line of code which I am using to extract those info.
file = svn.local.LocalClient(filePath[i][j])
fileInfo = file.info()
This works perfectly fine in my desktop. But the same thing when I tried to do it in my laptop it throws the following error
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\svn-0.3.22-py2.7.egg\svn\common.py", line 134, in export
self.run_command('export', [self.url_or_path, path])
File "C:\Python27\lib\site-packages\svn-0.3.22-py2.7.egg\svn\common.py", line 29, in run_command
stderr=subprocess.PIPE)
File "C:\Python27\lib\subprocess.py", line 711, in __init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Can anyone pls help me what is wrong? I have installed all the packages which I installed in my desktop. But don't know what is the problem exactly.
Thanks
You need to recheck that the files on your laptop and make sure:
The files actually exist / are the correct files.
They are in the directory you are trying to access them from.
The file names are spelled correctly.
If the system could not find the file specified it means something is missing / misplaced, or the file you are trying to access is not spelled the same as the one you actually want. Its most likely a simple error that could be found by just looking over everything and making sure its all the same as your desktop.
I got the solution for this. Actually the problem was with subversion command line client version. The client version need to be higher than the TortoiseSVN server version, whereas mine was a lower version which created this problem. Now it works fine :)
I was following the documentation of pgs4a, where in the build part I got a WindowsError [Error 2].
The Command and Traceback:
C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4>android.py build "C:\Users\karuna\Desktop\Jython\P
ython\pgs4a-0.9.4\mygame" release install
Updating build files.
Traceback (most recent call last):
File "C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4\android.py", line 66, in <module>
main()
File "C:\Users\karuna\Desktop\Jython\Python\pgs4a-0.9.4\android.py", line 54, in main
build.build(iface, args.argument[0], args.argument[1:])
File "buildlib\build.py", line 301, in build
build_core(iface, directory, commands)
File "buildlib\build.py", line 221, in build_core
subprocess.call([plat.android, "update", "project", "-p", '.', '-t', 'android-8', '-n', versione
d_name])
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python2.7 For Chintoo\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
As obvious,
I am using Windows 7, and have:
Python 2.7.3
JDK
Android Emulator
Device drivers for my Sony Tipo.
Please help!
By the way,
I would prefer to get this running on my phone first. I am thinking of moving to the emulator later(after the tutorial is completed).
Is this question more suitable for https://android.stackexchange.com/?
I am not sure if this is still an issue for you, but I ran into the similar issue recently and managed to solve it so I will just leave a note here.
If anyone gets this kind of error, go to pgs4a folder and android-sdk folder. There, run SDK Manager.exe file. You will see a list of Tools and different android versions. Try to find the version that you are working on and install everything that is 'uninstalled'.
I managed to solve the above issue by installing everything under my current AND previous Android versions. Hope this will help anyone who ran into the same issue!
rename the folder android-sdk-windows to android-sdk
I'm fairly new to programming and decided to setup a simple python script that would open all the applications I use for webapp development. The code I am using is (for GAE):
google_appengine = r'C:\Applications\google_app_engine\launcher\GoogleAppEngineLauncher.exe'
subprocess.Popen(google_appengine)
This works fine for the other programs I am opening, but I am unable to run any applications within App Engine after I have opened it this way. I get the following error in my App Engine log file:
Exception in thread Thread-2:
Traceback (most recent call last):
File "threading.pyc", line 486, in __bootstrap_inner
File "launcher\taskthread.pyc", line 65, in run
File "subprocess.pyc", line 587, in __init__
File "subprocess.pyc", line 700, in _get_handles
File "subprocess.pyc", line 745, in _make_inheritable
WindowsError: [Error 6] The handle is invalid
I'm guessing it is the way subprocess.Popen() works, but I haven't been able to find any alternatives. I'm running Windows 7 if that makes a difference. Thanks for looking.
if you want to manage the local dev_appserver, this is the wrong approach.
the best way to do this is clone the sdk repository (https://code.google.com/p/googleappengine/) directly to your drive and then add that path to your environment PYTHONPATH variable.
here's a link to a script template i created & often use to manage startup & killing of the dev_appserver process: https://gist.github.com/4514647
i'm not too familiar with managing a python environment on Windows, so you'd have to take my notes on a highlevel and research the specific implementation for that platform.