I've installed python 2.7 on my machine. Although path variables are set properly, whenever I fire python command, it opens up python prompt in new window. If I try to run it as an administrator, it works fine. But gives an issue for normal user.
It is resolved, python.exe was by default running as an administrator when python command was fired. Resetting it helped in resolving the issue.
reference_image
Related
Error screenshot of 'python3 -m idlelib'[] [This is where the idle is located]Sample screen shot of the program here I recently deletd my old python program and intsalled a new one but now the Python IDLE is not launching when I click it from the start program. Also tried ruuning as a administartor. But when I open the cmd and type: "python3" I am getting the terminal. But I need to code in the python IDLE.
I have adde the image of the python IDLE, if i click that program the notepad/termiunal is not opening.
I got it solved. It seems my 1. I haven't added my path in the user variablse and 2. In system variables the path given is wrong. And yes as said by #TerryJanReedy I have installed both microsoft and python.org versions, so I deleted all files and carefully re-installed again.
I am doing a research project that involves me running terminals in the Anaconda Command Prompt. I was able to install and work the current version of Anaconda (4.12) and get the command prompt running there, but I had to depreciate my version of Anaconda to 4.2 so I can work on my project using Python 3.5. That version of Anaconda could not open the Anaconda Command Prompt or the Anaconda Navigator on my machine, so I tried reinstalling the current version of Anaconda after uninstalling 4.2; however, now I have the problem where the Anaconda Command Prompt can't open (but I've been able to run Anaconda Navigator). I tried doing the following things to see if I could fix this issue:
Opening the Anaconda Command Prompt through the Windows Command Prompt; however, now I have the added problem of the Windows Command Prompt not opening (which I tried fixing in the steps below)
Running the command prompt in Windows Safe Boot Mode. This method did open the command prompt, but it opened it up under the wrong letter drive. On this mode, I get the directory:
X:\windows\system32
What confuses me is that I don't even have an X: drive on my machine.
Trying to use some of the commands I was going to use in the command prompt in Powershell; however, when I opened powershell, I got an error message regarding Execution Policies. I was able to get the error fixed by changing some of the Execution Policies. I changed the execution policy on CurrentUser and LocalMachine to Unrestricted. This solved the problem on Powershell, but didn't fix the problem with opening the command prompt.
Going back into the Safe Boot Mode Command Prompt and seeing if the letter drive had been fixed to the default C:. The letter drive is still X:.
I don't know what to do to fix this problem. I've tried many of the things I read online from windows and other forums, but so far they haven't worked.
I had the same issue, here is the solution (extracted from Microsoft Assistance Service):
The fix was to open Registry Editor by searching "regedit" in the start menu, then search for "autorun" in the Edit tab, and delete the "autorun" file from the system through right click.
The offending "autorun" element is located under the key:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
and contains an errorneous value if exists which prevented cmd.exe from starting properly.
I am trying to change the Executing Terminal for python in VSCode from Bash to CMD. I already tried changing the default terminal by following this, but no luck.
Detailed Explanation:
In Vscode , when i hit the run button for executing python. I see that , the execution automatically chooses the Bash terminal , but i would need the execution to happen in CMD.
You can check it in settings.
It's the same as adding the following line into your setting.json:
"terminal.integrated.defaultProfile.windows": "Command Prompt",
If it still doesn't work, try reinstalling vscode
If you just changed your default terminal, try restarting your computer, that worked for me, it wasn't taken into account before I did.
I always used the "Run python file in terminal"-button in Vscode, but some recent update seems to have broken it for me. My default terminal is cmd, but when I use the button, it now uses powershell and does not activate the conda environment, which prevents my code from running.
When I open up a new terminal manually, it rightfully uses cmd, activates the env and python <path> works again.
This is the output after pressing the run-button:
Does anyone know how to set the button to use cmd?
This is an issue of Python Extension. And it should be fixed tomorrow with the new release. You can refer to here for more details.
And have you add "python.terminal.activateEnvironment": true, in the settings.json file? Because it's weird, as the cmd activates the environment while the Powershell does not.
On my mac I am trying to make a Python script open by default in the Python Launcher.
I left click on the script and select "open with" and select the Launcher. Every-time I do this Terminal pops up, the Launcher window appears briefly. Then a messages pops up in a window: "Python Launcher can only run certain scripts try another."
Something along those line (the message has stop popping up since the first time I tried it but the script still doesn't run). I tried everything, GUIs, and basic scripts (like print "Hello World"). None work!
I tried doing the same thing on other computer and I get the same problem. What am I doing wrong ?
Does your script use a shebang line:
#!/path/to/executable/python2.6
And does it have execute permissions?
chmod +x path_to_file.py
It should run OK like this.
Assuming you're talking about Anaconda, Launcher is now deprecated, so your approach will have to change anyway. It has been replaced by Navigator.
Make sure you have updated Anaconda within terminal using
conda update conda
Then, you can install Navigator with
conda install anaconda-navigator
You will see a new icon show up that functions much the way Launcher used to. Your script will now have to be tied to it instead of launcher, assuming you figured that out with previous commenters' help.