ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 223 forks source link

Failed to create ( add ) Anaconda menus (to the system PATH) #732

Closed IkiAlex closed 7 years ago

IkiAlex commented 8 years ago

Hey there! If somebody can help me i'd be very thankful, cause i cant solve this by myself. As i see there is pretty odd issue, and i cant find a solution cause nothing works for me. I have very new virtual pc ( win xp 64 ) and i'm trying to install anaconda/ miniconda. No matter. So i got 2 errors i _have _to ignore :
Failed to create Anaconda menus Failed to add Anaconda to the system PATH

Ofcourse , if i just ignore this - nothing works. Cant launch even conda : Failed to create process Just cant understand why it doesn't work for me. I've installed anaconda on 4 different pc ( all win xp 64 ) And sometime it works, sometime doesn't

Regards, ALex!

javaSunson commented 7 years ago

when I delete all of the path ,install stil error

fcjdgmrvwm commented 7 years ago

if u encounter this problem, UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4 please get into this path, usually, C:\ProgramData\Anaconda2\Lib, edit _nsis.py, add two lines under 'import sys' as: import sys reload(sys) sys.setdefaultencoding( "utf-8" ) then in dir C:\ProgramData\Anaconda2, enter the cmd: python .\Libs_nsis.py mkmenus

TutCanada commented 7 years ago

I had this same problem in Windows 10, while installing from the executable Anaconda3-4.4.0-Windows-x86_64.exe. After trying several options, including the commands suggested above by christakahashi, the one that worked for me was to turn OFF virus checking in Windows Defender.

8gentile commented 7 years ago

use cmd not powershell. problem solved

cvredenburgh commented 7 years ago

OK, working in Win 10 on Dell XPS turning off the Win Defender and installing as Administrator for all users after uninstalling other versions of python worked.

ghost commented 7 years ago

As for me, I got python 3.5 already and a lot of other developer tools on my dekstop pc. Running Anaconda3.5.0.1 installer as Administrator and choosing install path without spaces solved the problem.

slipnickeldatamunch commented 7 years ago

The fix for me was to adjust one of the two java path statements. When you look at it in Windows 10 GUI, all look the same but when you see it in text, the /bin entry is in quotes. Removing those quotes allowed it to complete without removing the java path statements.

rmundkowsky commented 7 years ago

I am guessing that the installer like had a problem based on multiple visual c++ binaries being installed. I currently only have one and the install worked fine. Back when I had the problem, I had multiple visual c++ binaries installed. This is totally a guess to the root cause of the problem. But I do thing other settings help (e.g. keep path to Conda short, no spaces in the path, install as admin).

larssonbajra commented 7 years ago

anaconda

This is the error im facing.. Please help

goanpeca commented 7 years ago

@larssonbajra please open a new issue

jtcours commented 6 years ago

Hello all. I may have a handle on part of the problem. I'm hoping it sparks some ideas for others.

We're installing without admin privileges--local user only--on a Win 7 Enterprise 64 bit machine.

We first ran into the failure to create menus. I worked around it by opening a command prompt and running the commands below, following the lead of some of the previous posters. If you try this step, please note that I had to run them using python.exe, not pythonw.exe, and that I ran them from the installation directory:

C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3>python.exe -E -s "C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\Lib\_nsis.py" addpath
C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3>python.exe -E -s "C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\Lib\_nsis.py" mkdirs
C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3>python.exe -E -s "C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\Lib\_nsis.py" mkmenus

That got us menu entries and a working Jupyter notebook.

The next problem was when we tried to launch Spyder. It gave the same popup others have been getting about a missing Qt plugin: This application failed to start because it could not find or load the Qt platform plugin "windows" in "".

The first issue was that the path to spyder-script.py in the menu shortcut for Spyder was too long, and Windows truncated it at 260 characters. Here's what was in the shortcut's target. Notice there's no trailing close quote: C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\pythonw.exe C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\cwp.py C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3 "C:/Users/mxxxxxxn/AppData/Local/Continuum/Anaconda3/pythonw.exe" "C:/Users/mxxxxxxn

I'm not sure whether Windows keeps the full path buried somewhere, but just in case I created copy of cwp.py called cwp2.py and modified it to expand the "@" symbol to a full path:

# ADJUSTMENT:   
# If the caller included the "@" symbol in the args, replace it with
# the value of prefix to let callers use a shorter path.
args = [arg.replace('@', prefix) for arg in args]

subprocess.call(args, env=env)

That let me shorten the target in the menu entry to this: C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\pythonw.exe C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3\cwp2.py C:\Users\mxxxxxxn\AppData\Local\Continuum\Anaconda3 "@/pythonw.exe" "@/Scripts/spyder-script.py"

Unfortunately, pythonw is still generating the error about the missing Qt plugin. The empty string in the popup suggests it's getting an incomplete search path, but I'm not sure where its path information comes from.

msrkp commented 6 years ago

I am having same problem, I think why this happen to me is because of I was deleted Anaconda3 folder instead of uninstalling it. So, when I am trying to reinstall it , It's saying failed to add menus. I have to clean the previous paths and other stuff. I don't know how to this please help me to overcome this.

prihu commented 6 years ago

https://docs.anaconda.com/anaconda/user-guide/troubleshooting#windows-error-failed-to-create-anaconda-menus-or-failed-to-add-anaconda-to-the-system-path. Following this with All users did the trick for me

msrkp commented 6 years ago

Here is the solution I have found.

  1. Locate to the Anaconda3 directory where it is installed.
  2. And then go to the lib directory. Open cmd type below commands.

    cd C:\Anaconda3\Lib (Assume installed directory C:)

  3. Run _nsis.py . Follow below steps to addpath, mkdirs, mkmenus

    C:\python.exe _nsis.py addpath C:\python.exe _nsis.py mkdirs C:\python.exe _nsis.py mkmenus That's it. Hope it'll helps you to solve this problem.

VincentRouvreau commented 6 years ago

Thank you @piilupart88 I had an old Java path installation in my Path environment variable. I removed it, and it works !!

ImmortalSon commented 6 years ago

After trying almost all suggestions in this thread (removing java entries from PATH, running the installer as normal user / admin, installing only for myself / everyone, installing Miniconda and running conda install anaconda, running the scripts after install, uninstalling and reinstalling a dozen times) - nothing worked. The menu items in start menu stubbornly remained missing, and the anaconda prompt gave the infamous activate.bat error.

There was one suggestion that I could not try: temporarily disabling the anti-virus (Webroot SecureAnywhere), as it is a company machine (Surface Pro 4) and corporate policy doesn't allow even opening the Webroot interface, let alone disable it temporarily. Upon a hunch, I decided to try and install Anaconda in Windows SAFE MODE, and it worked!

Here's what I did:

  1. Uninstalled old non-working Anaconda, cleaned up PATH, restarted machine. I had JRE installed (not JDK), but I didn't uninstall it, as I need it for other programs. Also, there were several VC++ runtimes installed, I left them all alone.
  2. As given in https://www.itecs.ncsu.edu/helpdesk/kb/installing-programs-in-safe-mode/ I enabled services for installing programs in safe mode.
  3. Entered Safe Mode via shift-restart and chose WITHOUT networking, since I had downloaded the full Anaconda 5.1.0 x64 installer, and wasn't going to install vscode - I wanted the fewest services running. Crucially, Webroot SecureAnywhere wasn't running.
  4. Installed Anaconda for all users into the default C:\ProgramData\anaconda3 folder, and accepted the default options on PATH (unchecked) and registering python (checked).
  5. Skipped installing vscode.
  6. Rebooted normally. Lo and behold, Anaconda installed properly with all menu entries! I started Navigator for the first time, and launched Spyder with out any issues. Whew!

And created a GitHub account to post this update, in case there is any one else tearing their hair trying to install Anaconda...

alexeiz commented 6 years ago

How come this is closed? The issue is still here. I hit it when trying to install miniconda via scoop. Scoop runs the installer in silent mode, so the problem becomes even harder to identify.

Anyway, the issue has to do with either Windows PATH being too long, or PATH containing non-existent directories, or the whole environment variables block is too large. I was able to resolve this issue by reducing PATH to bare essentials temporarily in a command prompt:

set Path=C:\Windows\System32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0

And when I ran the installer from that command prompt, it finally worked.

jetilton commented 6 years ago

I had the same issue went through a lot of the above. Deleted anything anaconda/conda related and deleted my Path variable for my user. Everything installed as expected.

mars0925 commented 6 years ago

delete all Environmental variables PATH and install again. it work for me

yhling commented 6 years ago

Trying to install Anaconda 64-bit on a Windows 7 work machine, with only user privileges.

The only thing that worked for me is installing it directly under C:\. Installation completed successfully.

ldfreight commented 6 years ago

issue is still there. I am installing for all users with an admin account, on default path C:\ProgramData\Anaconda3

akhilachitluri commented 6 years ago

I am trying to install Anaconda2 version 5.2.0 32-bit in windows .I am getting this error. error

bbakk14 commented 6 years ago

Also getting this error and have been banging my head against the wall trying all of the suggested solutions in this thread. Any further help would be really appreciated!

capture

nehaljwani commented 6 years ago

@bbakk14 Open command prompt. Type: set COMSPEC. What do you see in the output? If it points to a file, please double check whether it exists.

bbakk14 commented 6 years ago

@nehaljwani It just says ComSpec=C:\Anaconda3; when I type set COMSPEC in CMD.

SandeepShaw2017 commented 6 years ago

Same problem ... tried everything in the thread above .... still getting the following error .... please help:

Traceback (most recent call last): File "C:\Users\admin\Miniconda2\Lib_nsis.py", line 212, in main () File "C:\Users\admin\Miniconda2\Lib_nsis.py", line 186, in main run_post_install() File "C:\Users\admin\Miniconda2\Lib_nsis.py", line 129, in run_post_install() subprocess.check_call(args, env=env) File "C:\Users\admin\Miniconda2\Lib_subprocess.py", line 185, in check_call retcode=call(*popenargs,*kwargs) File "C:\Users\admin\Miniconda2\Lib_subprocess.py", line 172, in call return Popen(popenargs, **kwargs).wait() File "C:\Users\admin\Miniconda2\Lib_subprocess.py", line 394, in init errread, errwrite) File "C:\Users\admin\Miniconda2\Lib_subprocess.py", line 644, in _execute_child startupinfo) WindowsError:[Error 2] The system cannot find the file specified

nehaljwani commented 5 years ago

Usually, in a Windows installation, the value of the ComSpec variable is C:\Windows\system32\cmd.exe, I am surprised that it points to C:\Anaconda3 for you 🤔

medengineer commented 5 years ago

Hoping it helps someone, I kept getting the 'failed to make menus' error on Win10. Removing Java from environment path did the trick.

diegormsouza commented 5 years ago

Hi all,

It happened to me and I solved doing this:

1-) Delete all variables from PATH (make a backup, to be able to put them back again later). 2-) Deleted JAVA SDK and JAVA related variables 3-) Downloaded an old version of Miniconda (early 2019): https://repo.continuum.io/miniconda/

Then it installed well. After that, put the PATH variables back.

anderl80 commented 4 years ago

Whaaaat? Cannot be true!! Anaconda starts to do weird things on my environment...

vxfranky commented 4 years ago

Another solution: install Microsoft Visual C++ Redistributable. Visit https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

piyushshahu commented 4 years ago

If you are using windows 7 and if this problem persists after formatting. Just update to service pack 1 (KB976932) then install another update of KB2999226. This helps in my case to solve the "create menus" problem.

HridoyHazard commented 2 years ago

i'm having the same issue now. tried 64bit and 32bit both but there were no problem while installing but after the installation i don't have anaconda-navigator in start menu or anywhere. i have this folder in installation directory.and if i open the conda.exe file it just automatically close after open. plz help image