Unable to create process - python

I updated my python version and when I try to run server on prompt for django I get this error.
Unable to create process using 'C:\Users\ALFRED\AppData\Local\Programs\Python\Python311\python.exe
manage.py runserver': The system cannot find the file specified.

This error occurs when the file system of the target device is corrupted or damaged, making your hard drive, USB or external hard drive inaccessible.
Are you sure you typed the right command python manage.py runserver.

Related

PyCharm Error when setting remote interpreter -> Run Error: Jupyter server process failed to start due to path mismatch issue

I am trying to setup remote development on PyCharm. For this, I want to make changes locally and execute the code on remote Amazon EC2 instance with a remote interpreter. I had done the following configuration of the project, but I am getting run error when I try to execute a ipython file created locally.
Cannot run program "stfp://<remote server hostname>/<remote server host>:<remote interpreter path>" (in directory <local folder directory>): error=2, No such file or directory.
It seems it should open <remote folder directory> instead of <local folder directory> when running the program. I read through multiple setup instructions but could not get this fixed. I am attaching configuration below.
Can you please help me with what could be wrong?
Updating PyCharm to 2022.3 can fix the issue. This seems to be related to an unstable older version.

Running Python script as Executable

I have been attempting to run my python script as a service, and have followed the advice contained in several previous forum posts. However, these have not helped me thus far. Here is what I have attempted up until now:
Used an SMWinservice class that allowed me to install my Python script as a service. This solution, however, would not launch. If I would try to start it, I would receive an error message.
I have tried using NSSM with : nssm install myService pathToInterpreter PathToScript. Note, all files etc. can be found in the local directory of the PathToScript. For what its worth, I also tried using the GUI version of NSSM. When I rebooted my computer, it showed as "Paused" in task manager. I stopped it, and then tried to run it again, and I received an error. I have tried NSSM with both python.exe and pythonw.exe.
I suspect that a possible source of error is the fact that my program uses a text file as a configuration file. This configuration file has been coded as being in my local working directory. However, I wouldn't think this would be an issue with NSSM. I know for a fact that my program will completely exit, using the exit command, if the configuration file is not found.
I was thinking of doing a batch file and starting the batch file with the script and running it like that, but I prefer a service since it can monitor the process, can restart it, or windows can notify me via email if there is an issue with my service.
For completeness, I should also mention that the program runs without issue outside of a service. For the reason that the program runs as expected, I decided to not post the code, unless someone would like to see it for whatever reason.

Problems installing Cloud SQL Proxy on Windows 64-bit

I'm trying to install Cloud SQL Proxy for Google Cloud Platform on my Windows 10 64 bit OS, so I can use Python scripts to dump data into SQL. I'm following this guide to get it set up.
I created a project and a Google Cloud SQL instance from the Console without any issues, and it shows up in the SDK shell without any problems. After downloading the proxy installer and installing it, a dialog window opens up and then closes before I can read it.
When I go to the Google Cloud SDK shell and try to start the Cloud SQL Proxy with: cloud_sql_proxy.exe -instances="[MyInstanceConnectionName]"=tcp:3306
No matter how many times I try, it throws the error "Cloud Sql Proxy is not recognized as an internal or external command, operable program or batch file." I already tried re-downloading and re-executing the file but it still won't work.
I have Python 3.6 with Anaconda and Google Cloud SDK shell installed on Windows 10 64-bit.
When you download the cloud_sql_proxy file make sure to rename it as per instructions in the how to guide. Also make sure you save it in the root directory of where you will run it from. E.g. If you are running the command from C:/users/desktop>.\cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306 then the cloud_Sql_proxy file must be located in the root C drive.
Open PowerShell or whatever terminal you use and navigate to the folder you saved cloud_sql_proxy.exe then add .\ like so:
.\cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306
I had the same problem, and i solved it by adding .\ before
so it would be like this
.\cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306
and I used PowerShell instead of normal cmd
Go to folder where you save proxy exe file and run following command
.\{cloud_sql_proxy file name}.exe -instances={projectID}:{zone}:{sql instance name}:{database}=tcp:{port} -credential_file={service account file path}
For instance related detail go to the instance look for "Instance connection name"
Your command is missing .\ before cloud_sql_proxy.exe -instances="[MyInstanceConnectionName]"=tcp:3306

Remote debugging eclipse+pydev with ssh connection to linux server breakpoints are not found

I am struggling on setting up pydev remote debugging feature.
I run Eclipse on my windows laptop and the code is on the linux server.
As far as I've understood the manual http://www.pydev.org/manual_adv_remote_debugger.html I have to have an exact local copy of the code to debug on my laptop and I need to link it with the code on the linux server with PATHS_FROM_ECLIPSE_TO_PYTHON variable. However no matter how I set this variable in the pydevd_file_utils.py on the server the paths in the error message don't change.
For each breakpoint I receive:
pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/user/D:\Workspace\RemoteSystemsTempFiles\****\home\user\Code\reco\Test2D.py (will have no effect)
Error message
How can I link this particular file, so I can debug it with breakpoints? Is a local copy of the file necessary, even though I can access the original file via windows network drive mapping?
Actually,
I have solved it in a not very intuitive way. For some reason, PATHS_FROM_ECLIPSE_TO_PYTHON variable in the pydevd_file_utils.py file didn't change the really used path for the server. I had to manually edit the _norm_file_to_server function in changing the path for the translated variable from _NormFile(translated) to the path of the debugged file e.g "home/user/code.py". After starting debug server I could start the execution of the file with a remote console, e.g python "home/user/code.py"and it worked properly by popping up and stopping at the breakpoint in eclipse.

How to run python files on tomcat server?

I have installed Tomcat in my system and when I type "http://localhost:8081/"
I get the following screen
However when I try to run a .py file from Tomcat, it is unable to interpret the file and shows me the following screen. What should I do to resolve this issue?
Tomcat doesn't know how to run Python scripts without additional configuration. You need to configure Tomcat's CGIServlet in order to run Python scripts.

Categories