Python script not running from SQL Server Agent
the python script makes use of the requests library (installed)
when i run from CMD :
python "C:\Program Files (x86)\Python37-32\main.py"
this works fine.
when i run it from SQL agent as an Operating System (CmdExec) all i get is "System cannot find the file specified"
i have set the enviorment paths.
I have created a proxy account (sys admin)
i have copied the requests library so its in the same folder as Python.
nothing is working
37 failed attempts today , and counting !
can anyone assist>
python "C:\Program Files (x86)\Python37-32\main.py"
i managed to get it working.
manually moved some libraries around in python.
Related
I am using on a 64-bit system running Windows 11 with Python 3.7 installed and working in a virtual environment where I have installed Django 3.2. I am trying to deploy my project using Heroku.
I have tried adding heroku cli 64-bit Windows version to various paths. I have set the env variable HOME with a value of C:/Users/<username>/_netrc. I have cleaned up the path on each installation so there is only the current path.
When I run heroku login from within my project, I get the following error:
EPERM: operation not permitted, open C:/Users/<username>/_netrc
Any help here is appreciated
I have set the env variable HOME with a value of C:/Users/<username>/_netrc
HOME should be a directory. Heroku will take care of the _netrc part.
Try setting it to C:/Users/<username>/ instead.
delete the existing file in path C:/User//_netrc
used git bash or terminal for it as i was unable to find the _netrc file in file Explorer.
after deleting It run the below command in project folder.
heroku git:remote -a <heroku_app_name>
by running the above command it will create a new _netrc file
I want to launch Django application without giving command "python manage.py runserver".
Like how php works, when hit the index file it will launch the application but in django/python i didn't find any way to do that in windows OS except run the project from command line which is cautious for robust application.
Please let me know/suggest any idea about if it is possible for windows or not??
My GCP Compute Engine instance running WS 2012 does not execute an executable command while using using a startup script.
Summary of steps followed:
I created a Compute Engine instance with WS 2012.
Set Metadata keys windows-startup-script-cmd with value = `"c:/prog/1.exe".
copied all needed files to local disk.(exact folder c:/prog/).
Shut down VM. (by GCP console).
Started instance from the GCP console.
And it seems that the command "c:/prog/1.exe" did not run
I saw "1.exe" process running in the Task Manager but it did not do anything . (It should have created a specific file to show that it ran successfully).
Please, tell me if I did something wrong, Or if I missed anything.
Thanks for your help .
The windows-startup-script-cmd is metadata key to run cmd startup scripts on Windows instances. The cmd startup scripts are those with .cmd or .bat extensions. You can run your executable files through a batch file. How? visit this answer on stackoverflow.
I have a batch File that runs Django Server and it works perfect.
c:\Python27\python.exe manage.py runserver 8003
and that I am using a 3rd Party app NSSM https://nssm.cc/
Which run my Batch file as a Windows Service.
the point is the Service does not start the Server. How can I run the server using this service; the service will open the cmd and execute the command.
Should I use another 3rd party app or is there any command that I can add to my batch file and update it the serive
If you want to run django as a Windows service for development purposes (see the comment above), I have had good luck with instsrv and srvany, both Windows tools that work on all Windows platforms. See https://www.iceflatline.com/2015/12/run-a-windows-application-as-a-service-with-srvany/ for details.
I'm setting up a Google App Engine Django project to run in a Vagrant environment for easy setup/teardown of the system and am using PyCharm as the IDE for it all. I'm able to successfully get the server to run using PyCharm on the remote machine, but if I try to use the remote debugger to start a debug session, PyCharm gives me a nondescript error:
Error running webapp: Can't run remote python interpreter: Couldn't obtain remote socket from output , stderr File "", line 1
import
^
SyntaxError: invalid syntax
I'll try to include as much info about the setup as I can:
Windows 10 host machine, Ubuntu 14.04 guest
Python is version 2.7.10
/home/vagrant/www/shell/python-su.sh setup as python interpreter. Just passing arguments to sudo /usr/bin/python $# to make it work in vagrant/GAE
GAE Directory in PyCharm is set to /home/vagrant/google_appengine/ to make it work on the remote machine
Here's a screenshot of my PyCharm Configuration Settings for launching debug client:
All of this matches what I do for the run configuration and that works fine. It's only the debug configuration throwing this error.
From the help documentation for PyCharm, I found this article detailing how to turn on more logging to the PyCharm log file. Add this to the log.xml file located in the /bin/ directory of the PyCharm Program Files directory:
<category name="#com.jetbrains.plugins.webDeployment">
<priority value="DEBUG"/>
</category>
Looking at the log file showed what command it was trying to run, which I was able to run by SSH-ing into the machine to run it myself. From there, I was able to figure it it was coming from my sudo python file. I had to wrap the $# in quotes to get it to work properly. The run was working because the arguments were simple enough that it didn't matter that it wasn't quoted. The final python sudo shell file looks like this:
sudo /usr/bin/python "$#"