Command Prompt / Anaconda Command Prompt not opening in Windows 11 - python

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.

Related

Conda keep opening this Python Interpreter

I installed Anaconda 3. After Install I reboot the computer but, when I opened Anaconda Navigator, this keep happening, first this CMD window appears Conda.exe
and then this window appears gpython.exe
Before reboot, everything fine, I could open Anaconda Navigator. After reboot, (insert Billy Butcher from the Boys) BOOM, this happen.
This also happens everytime I type "conda" on the command prompt,with the python interpreter (second picture) keep appearing. So pretty much any solution on the internet that told me to use "conda" doesnt help.
Also this happens to every Anaconda Application (Anaconda Prompt, Anaconda Navigator).
I believe that whenever you launch anaconda conda.exe will run, at least it does for me.
Regarding gpython.exe, I could only find the following question referring to it
Django error: Command throws a python window when executing makemigrations command in a Python/Django project
This makes it seem like your anaconda may require a reinstall, I checked my anaconda files and couldn't find a gpython.exe in the path where yours appears, so this may be the case. Hope this helps.

Idle and Anaconda

I use to have idle. Then I downloaded Anaconda and opened idle through there. I have not used idle for a while but just recently went to go open it up and use it again. However, it seems I no longer have idle on my computer, to my understanding I can still get to idle through Anaconda but I forgot how. Is there a way to open idle through Anaconda without re-downloading idle? If so what command can I use to pull Idle up?
Search for this folder "idlelib" in the Lib folder of the Anaconda version you have installed and you will find idle (check its file type: "compiled python file").
Pin it to your taskbar and run.
You are looking for C:\... <\> ...Anaconda3\Lib\idlelib\idle.bat
There is also C:\ ... <\> ...Anaconda3\Scripts\idle.exe which seems to run a little smoother, but there has to be a Command Prompt open in the background to run. ... ?
Navigate to your Anaconda3 installation folder. Yours could be anywhere, mine is at "C:\ProgramData\Anaconda3", but I installed for all users and you could have selected a random location on your drive. If you managed to add it to the environment variables you could easily find it by running the Command Prompt (not Powershell - has to be Command Prompt) and typing where conda or where anaconda and pressing enter. You should find a folder named Anaconda3 or something of that nature.
If you navigate to this folder, and within it find the "Anaconda3\Lib\idlelib\" folder, within it there is a file called "idle.bat". If you find this "Anaconda3\Lib\idlelib\idle.bat" file you can double click it to run IDLE, although it may be a little messy/outdated/glitchy/strange since you are updating all kinds of folders within Anaconda and some of them may have helped idle.bat run. Mine has a the spyder icon associated with it in the task bar and a blotted out IDLE icon in the top left corner for some reason. You could of course run the full path in command prompt as well if you already know where it is, for instance I would run...
C:\Users\Thomas>C:\ProgramData\Anaconda3\Lib\idlelib\idle.bat
~or~
C:\Users\Thomas>C:\ProgramData\Anaconda3\Scripts\idle.exe
--> It may be easier to just download a new version of Python side by side with Anaconda to run IDLE. I have been attempting to set a shortcut in the Start Menu that runs from anaconda properly for days and have failed. This way, there should be a right click>'run with IDLE' option for python files.
I believe the tilde slash (~/) was meant to imply your home directory since that is what it signifies on a linux machine, but seeing as you could have put it anywhere on the machine, even directly on the C:\ drive, maybe he meant 'unknown file path'.
If you are running MacOs (currently I am on Catalina - MacOs10.15) it is quite simple to run IDLE from Anaconda environment:
Launch Anaconda
Go to MacOs Terminal.
Type IDLE3
warning: if you type IDLE, the Python 2 IDLE will be opened ... but if you are using Python3 installed with Anaconda ... it doesn't work properly.

Errors with conda commands on Windows 10

I'm getting started on Python 2.7, using the Anaconda package and its Spyder IDE, but when I find out that something I want to do requires that I execute a command that starts with the word "conda", I have terrible trouble.
I first assumed that those were commands to type in the IPython console in Spyder, but instead of executing what I commanded, it told me NameError: name 'conda' is not defined.
I also tried the Windows Command Prompt (cmd.exe), but it told me conda is not recognized as an internal or external command. Some results when I googled that claimed that I had to add one of the Anaconda-related folders to Windows' Path, so I tried that, but still no good.
How can I carry out conda commands on Windows 10?
Just Run Command Prompt with Admin permission then it will install desired package and will work perfectly
First thing, you're right that those commands are not intended for the IPython console. Second, there is a good reason they are not working in the cmd.exe Command Prompt.
They are actually intended to be given to the Anaconda Prompt. On Windows, start typing "Anaconda Prompt" and, if you have Anaconda correctly installed, you should see an icon very similar to that of cmd.exe, except the "C:_" on the black background will be grey instead of white. That is where these commands are to be given.
If you are not sure which user/users Anaconda was installed for, it may take some extra time. If it was installed for all, or you're not sure, then you should go ahead and left-click the icon. If it was installed for you, everything should go fine, at least as far as permissions go.
If it was not installed for you, then it will at first seem to be obeying you when you command it to modify the software. It will fetch the metadata, tell you that these things will be installed or updated, and then ask you Proceed ([y]/n)? And then, after you type in y and hit Enter, it will tell you CondaIOError: IO error: Missing write permissions in: C:\Program Files\Anaconda3. Now you know, you need to open the Anaconda Prompt by right-clicking the icon and clicking "Run as administrator". Then you can type in your conda install... or conda update... command and see it carried out.
(This might only be possible if your Windows account is an administrator account; if that is true and you're not an administrator, you'll probably need to ask someone who has an administrator account for help.)
Credit to users on Google Groups for showing this solution.

Running python on Command prompt:Access is Denied

I installed python long back and worked fine for all these months, I could install libraries from command prompt..run python programs using shell from vba until one day..It started failing, I am able to run python scripts from idle but not from command prompt or vba. I have tried checking my permission but to no success.
If I type python on command prompt, it says the app can't run on this pc and later "Access Denied" displays on the prompt.
To someone who might find this: I had the same problem, when I checked the python.exe file located at C:\Users{your user}\AppData\Local\Programs\Python\Python37 it had 0 bytes, I just reinstalled it to solve the problem, I don't know how this happened.

Python Installer: "Error writing to file C:\Python27\pythonw.exe"

I am trying to install Python 2.7 (64 bit) on Windows 10. In the middle of the installation, a window pops up saying:
Error writing to file C:\Python27\pythonw.exe. Verify that you have
access to that directory
How can I resolve this issue and install Python?
This error is normally encountered when the installer does not have admin rights for the drive/folder you are installing to. I also noticed that you are installing to drive C:
Here are a couple of things for you to try.
Open the installer program by right-clicking, and then selecting "Run as Administrator".
Depending on how you have your PC set up you may not have permission to install on drive C:
If this is a work computer, talk to your IT department. Otherwise, seriously consider using different drives to keep your OS and your applications separated.
I encountered a similar issue while installing Python 2.7.11 on Windows 7 (64bit). Here is how I solved the error.
Note down the path mentioned in the error.
Do not close the error message. i.e. Do not press "Retry" or "Cancel", let it be there.
Go to the directory mentioned in step-1.
Try to create a new folder or text file in this directory.
You will get an error message saying "The Disc Structure is Corrupted and Unreadable". This is the real issue which is causing the Python installation to fail.
Run Command Prompt as an administrator and enter the command: Chkdsk \f C:
Either it will start checking the disc or it will ask you to select if you want to check disc next time you boot-up your machine. Select Yes and restart your machine.
A disc check will be performed, which may take 5-10 minutes.
Now you can install Python without any issue.
I had the same problem , this is how I solved the error :
click on cancel
go to c:\
create a new folder and call it python or python3
run the python install as administrator and choose the new folder that you just created
as directory where it should be installed
et voila !
Your Windows 10 version may not be activated. So many administrator features are locked in inactivated Windows10 version.
So try to open CMD in administrator mode and run following command to ignore the activation message.
slmgr -rearm
Now you can install fresh version of python with pythonw.exe features.
Right Click The running Uninstaller. Then Right Click Python 3.9.1 64-bit as shown below in the picture. ( I have Python 3.9.1. You can do it in any Uninstaller) Now it will repair without any errors. ^_^

Categories