Why did I randomly lose access to windows command promt? - python

A bit of background:
I'm trying to convert a python tkinter script I have into an .exe for my coworkers to use. I installed pyinstaller successfully and was able to run pyinstaller my_script.py --onefile however I could never get my application to open due to a windows cannot open error. I thought this had to do with how pyinstaller ran so I kept deleting my app and associated files to try again. Eventually I tried using auto-py-to-exe to get this job done so I installed that. When I went to run this by simply entering auto-py-to-exe I got the Access is Denied error, and when I went back to trying pyinstaller again I started getting Access is Denied for that as well. Even if I just try to run pyinstaller --help I'll get Access is Denied. I don't understand how I could randomly get locked out like that and any help would be appreciated.
I've tried googling and troubleshooting this issue and I haven't really been able to find anything that seems to help me. This is a work machine that I'm using and I don't have access to the admin profile so I am unable to run any of these commands as an administrator.

It looks like you're running into a permission issue on your work machine, which is preventing you from executing PyInstaller and auto-py-to-exe.
Unfortunately, since you don't have administrative rights on the machine, there might not be much you can do to resolve the issue. However, here are a few suggestions that you can try:
Check if there are any restrictions set by your IT department that are preventing you from executing the software.
Try to run the commands from a different command prompt or terminal, such as the Anaconda prompt.
If you have access to a different machine, you can try using that to compile the script instead.

Related

Python was not found error when runnig code

After a few routine windows updates, I started getting this error when I was running python code in VSCode.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
I got told to first check PATH and to untoggle Python in App Execution Aliasies. I figured that python was already added to the PATH (I had just checked the box when downloading) and that when I untoggle Python in App Execution Aliasies I get another error
'python3' is not recognized as an internal or external command, operable program or batch file.
So I'm essentially stuck between two different errors and a correct PATH and the only times when I can run a code is when I run it from the default Python IDE that comes in the download package.
Anyone know how to fix this?
PS. when I download Python from Windows Store, it works but I don't know how to use pip with it to install external packages.
Below is the pic of my PATH.
Please reinstall python. When you install python, there will be a prompt in the lower left corner to automatically add it to the environment variable. Please check it.
At the same time, please select the correct Python interpreter in vscode.
You can refer to docs for more information.

Django3 - manage.py commands stuck

I have a big problem wih Django3: basically, whenever I type a command for manage.py, the prompt gets stuck and never carries on the command without even crashing.
I tried several times the commands "runserver" and "startapp" and waited beetween 10 minutes and an hour, but I never managed to run the server or create an app because I launch the command and the prompt gets stuck.
Strangely enough, to test things out, I created a project, an app and run the server immediately after I installed Django3 and everything worked fine, I even have that project on github. Then I shut down the computer and now nothing works, except my test project.
Also, I noticed in the Windows resource monitor that whenever I try to lauch a command suddenly Python processes start to appear and disappear uncontrollably, and since I never had an issue like this I'm absolutely clueless about everything. So... What's happening? Did someone have the same problem?
I have the lastest Windows update, the latest Python3 (I got it via Windows Store) and the Latest Django3 (I got it via pip). I'd include a stacktrace or some sort of log but, since nothing crashes, I suppose no log gets done: if I'm wrong please correct me, please!
EDIT: I tried uninstalling and installing Python but the problem is the same: I created a test project and I successfully ran the server and started a new app. Once again, I shut down the computer and now everything is broken again.
Ok, thanks to ansuman I discovered virtual environments and now everything works again.
If you're a noob like me and you want to know more go check the virtual environments documentation, it's extremely helpufl if you're experiencing (supposed) module conflicts like me. Also, it's such a cool feature: start using venv now, you won't regret it.
Here's what I did step-by-step:
opened the command prompt (duh);
installed venv via pip;
created a folder for the virtual environment with python -m venv site-venv;
went into the newly created directory;
created a new Django project with django-admin startproject site;
went into the subdirectory Scripts of site-venv and typed activate;
with the virtual environment activated, installed Django via pip;
started doing all the manage.py stuff.
Hope this help someone! Thanks again to ansuman.

Python: Installing virtual environment on network drive

I wrote a Python program that I use daily at work, and I was hoping to be able to pass it along to others who have zero programming experience.
I need to avoid having each user download Python and the relevant dependencies, and I also can't compile it into an executable.
I tried creating a virtualenv on a network drive, and made a .bat file that activates it and runs the script in the environment. It works for me, but other users get a "Can't find python34.dll" error when they try to run it.
Is there anyway around this? Am I going about this incorrectly? The goal is to have non-Python users be able to run the script without installing Python or compiling it all into a .exe.

"pythonw.exe has stopped working" crashing error after launching anaconda

After launching anaconda, python crashes with message "pythonw.exe has stopped working".
Please find error screenshot here
I had downloaded some packages(nltk). And after that my anaconda stopped working.
It is giving me Navigator Error :
An Unexpected error occurred on Navigator startup
psutil.AccessDenied(pid=3232)
Tried reinstalling the anaconda,
Also reboot the system,
Fired 'conda update anaconda-navigator' command.
But does not worked.
Access Denied errors usually mean a process is trying to open a file that's already open, or the program doesn't have sufficient permission from Windows to read the particular file.
In this case, it looks like the anaconda-navigator package is having trouble. Look at the python scripts mentioned in the error trace (start.py, line 108 and misc.py, line 348) and try to find out what file it is trying to open. Then, go to that file in Windows Explorer and give whatever user pythonw.exe is running under (probably your user account, or possibly the Administrators group) permission to read that file. Depending on what navigator's trying to do, it might need write permissions as well. See here for more info on Windows File permissions.

Errors while attempting to install Python 2.7.13 and 3.5.2 on Windows

I have been trying to install either Python 2.7.13 and 3.5.2 on Windows 64-bits. I continue to get the following error:
Error writing file: C:\Python27\tcl\tcl8.5\encoding\ascii.enc.
Verify that you have access to that directory.
I have tried EVERYTHING suggested on Google search outcomes, including trying to install it in a drive other than C, running chkdsk at boot time,and many other suggestions. I verify that I have full access to the directory. I also tried the installation as Administrator. Nothing works for me.
Can someone help?
Thank you.
Try going to your c drive and checking the security settings. Make sure you have full rights to it. Then go to your accounts in control panel and make sure you are an admin.
You can also go into the directory and try to save a txt document to see if you have permissions.

Categories

Resources