简体   繁体   中英

Anaconda Prompt Stuck/Closing after Keras installation

So I recently downloaded keras through the anaconda prompt (I've downloaded other packages successfully). It actually worked, as I was able to import keras in Jupyter Notebook. However, now I get the following issue when I open the Anaconda Prompt:

C:\Users\[User Name]>python C:\Users\[User Name]\Anaconda3\etc\keras\load_config.py  1>temp.txt
python: can't open file 'C:\Users\[User]': [Errno 2] No such file or directory

C:\Users\[User Name]>set /p KERAS_BACKEND= 0<temp.txt

C:\Users\[User Name]>del temp.txt

C:\Users\[User Name]>python -c "import keras"  1>nul 2>&1

Things to Note:

  • At first, I simply cannot type or enter anything into the window.
  • After closing and reopening it, the same message opens up, but is followed by a bunch of text I can't read because the window immediately closes afterward.
  • In the error message provided, the third line has [User] instead of user. That is because my users folder name on my computer is FirstName LastName. There is a space which I'm wondering might be the issue.
  • I don't want to uninstall anaconda, as I have a project due in a few days and don't want any installation/loss of data issues.

So, is my folder name having a space the root of the issue? If it is, how do I change it without messing up my computer? If it isn't, do you guys have any ideas of what is the solution to this? Thank you so much, I have two projects due in just a few days :(

After a few days of searching, I found an alternative solution.

  1. Open Anaconda Navigator

  2. Click on Environments tab ( as shown in the picture) 在此处输入图片说明

  3. Click base(root) (triangle icon) and then click on Open Terminal 在此处输入图片说明

By using this solution, you'll be able to open Anaconda Prompt window and do whatever you want with Anaconda Prompt . 在此处输入图片说明

Use quotes. This is a cmd.exe parsing question.

python.exe "%USERPROFILE%\Anaconda3\etc\keras\load_config.py" > temp.txt

delete files in C:\\Users\\your_name\\AppData\\Local\\Continuum\\anaconda3\\etc\\conda\\activate.d

or you can reinstall/remove keras from anaconda navigator: - right click env name - start terminal - ctrl-c to stop any batch job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM