Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
IkiAlex opened this issue Apr 1, 2016 · 83 comments
Closed

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

IkiAlex opened this issue Apr 1, 2016 · 83 comments
Assignees

Comments

@IkiAlex
Copy link

IkiAlex commented Apr 1, 2016

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!


@IkiAlex IkiAlex changed the title F Failed to create ( add ) Anaconda menus (to the system PATH) Apr 1, 2016
@msarahan
Copy link
Contributor

msarahan commented Apr 1, 2016

There may be up to three things at play here:

  • if you have other versions of python installed and on PATH, the installer may erroneously try to use them to make menus, and will probably fail.
  • there was a race condition in the installer scripts that led to deletion of scripts before they finished installing. This fix has not yet been released in a miniconda installer.
  • our python 2 installers don't properly support non-ASCII characters right now. Python 3 installers should, but more recent ones do not support Windows XP.

I hope this helps you narrow it down. If you can isolate it, please let us know.

@IkiAlex
Copy link
Author

IkiAlex commented Apr 1, 2016

ty for fast reply.

  1. I thought about it. That's why i've installed "clean" ver of win xp as virtual machine
    2.I also tried to install anaconda instead miniconda and received the same error. I only work with mini right now,cause it's faster to test (30 vs 300 Mb)
  2. I have to use python2. I can't see any non-ASCII chars in any path. Maybe there is some kind of trick i should use to avoid this error with changing some registry key.

@msarahan
Copy link
Contributor

msarahan commented Apr 1, 2016

what locale is the system set to? Do you have any way of sharing the VM with us so we can study this more closely? Our main issue in studying this problem has been inability to reproduce it.

@IkiAlex
Copy link
Author

IkiAlex commented Apr 4, 2016

sry fo long no-respond .This is exactly what i'm using right now:
https://yadi.sk/d/nnHEzl0WBCumY

@IkiAlex
Copy link
Author

IkiAlex commented Apr 6, 2016

Well.... I have nothing to say. Now it works on my vm (2 d ago didnt, now does! ) I did nothing.
And still i cant install it to my work pc ( where i need this )
I just dont know whats going on ...

@msarahan
Copy link
Contributor

msarahan commented Apr 6, 2016

It sounds like our race condition is still alive and well. I will try to investigate.

Even when that part of the installer fails, you should be able to use the installed python, though. Open a prompt in the folder where you installed it, and run python from there. Does it work? If not, any error would be helpful to understand why the installer might be failing. If it works and you just want to run with it, you can manually modify PATH and install shortcuts. Let me know if the installed python works, and I'll point you to directions.

@IkiAlex
Copy link
Author

IkiAlex commented Apr 8, 2016

Ty for your time,I appreciate You still trying to help. Sry for long no-respond sometimes.
Well, quote : ".. If it works"
I wish...it would be to easy. But it doesn't
"Could not execute specified program" , when i'm trying to run c:\Miniconda2\python.exe
"the application was not running because it is incorrectly configured. Re-installing the application may fix this problem" if i 'm trying to execute python.exe at folder (by double clicking) .
"Failed to create process" when i'm trying to run ..\conda.exe

@IkiAlex
Copy link
Author

IkiAlex commented Apr 8, 2016

Well . Seems like i've found the solution. Unfortunately I can't test it now , cause I haven't access for all machines right now , but it works at local pc ( same as others)
The solution was to easy. i only had to install (vcredist_x64.exe , Microsoft Visual C++ 2008 Redistributable Setup ) I'll reply next week does it rly fixes the problem, but guess so

@g4u55i4n
Copy link

Hi Mike, thank you and sorry for that - sounds like incompetence to me

@develmusa
Copy link

I had the same problem.
Solution: Execute the "addpath", "mkdirs", and "mkmenus" for the cmd with admin rights.

bsp

Without admin permission this error shows up

prob
("Zugriff verweigert" means permission denied)

Here my install log log.txt

@jcmorris-mts
Copy link

Just to make SeppDeDepp's answer a bit more convenient...

  1. Save the code below as a batch file in <ANACONDA_HOME> where your python is located.
  2. Run it as an admin. Works a treat!

Assuming <ANACONDA_HOME> = "C:\Anaconda3"

REM Fix.bat
"C:\Anaconda3\pythonw.exe" -E -s "C:\Anaconda3\Lib\_nsis.py" addpath
"C:\Anaconda3\pythonw.exe" -E -s "C:\Anaconda3\Lib\_nsis.py" mkdirs
"C:\Anaconda3\pythonw.exe" -E -s "C:\Anaconda3\Lib\_nsis.py" mkmenus

@eunseop90
Copy link

Hi~

I am trying to install minianaconda, but I cant.
When installing, I had the same problem, and following above method.
Until 'addpath' and 'mkdirs' are worked well, but at entering mkmenus, I have some problem like this.
image
image

(I run 'cmd' as admin.)

Please help me :(

@prithvikg
Copy link

Did some research and found out it was because my path variable was too long. Windows apparently has a limit of 1024 for path length. so i cleared some variables and reinstalled and it seemed to work fine

@luishang
Copy link

Same problem here. 'addpath' and 'mkdirs' worked well, but mkmenus, didn't. I'm also running in cmd as an administrator and the length of my path is shot: c:\Anaconda

@BillDineen
Copy link

I have a new laptop with win 10 64 and have the exact same issue on first installation attempt. Any suggestions?

@eunseop90
Copy link

Hi~

I have solved this problem.

In my case, English is not my native language, so when I install windows 10 in my computer, I type my name as Korean.

This cause the problem like this.

Thus, I change my name into one as English, It works well.

@augustoproiete
Copy link

augustoproiete commented Nov 22, 2016

I've just had the same issue on a Windows 10 machine (Anaconda2-4.2.0-Windows-x86_64.exe). No special characters in my name or path, no blank spaces either, my user is admin on the machine, and UAC is turned off.

Running addpath, mkdirs, and mkmenus from an elevated prompt didn't work either.

The only way I could make it work, was running the installer as Administrator, and installing it for All Users.

@rTfact
Copy link

rTfact commented Dec 1, 2016

Had the same problem on Windows 8.1 Enterprise.
Tried the fix-script, but it didn't fix things.
My path is not very long: approx 163 chars. Std. ascii username.
Anaconda3 4.2.0 (64-bit).
Installing for All as Admin worked.

@MarkusFK
Copy link

MarkusFK commented Dec 3, 2016

I tried the same that @caioproite sugested on my Win 10 (64 bit system) with (Anaconda2-4.2.0-Windows-x86_64.exe), run it as admin installing for all users. And it didn't work. Got following message:
anaconda error_4

Can anybody help me? thanks.

@TheBeege
Copy link

So if this is such an easily fixed problem, why isn't the Windows installer fixed?

Is there a repo for it? I'd be disappointed if there's not a PR already, but I'll create one if there isn't.

@TheBeege
Copy link

@MarkusFK - I'm guessing you should be able to change line 172 in knownfolders.py to use path.decode('utf8') rather than whatever codec it's attempting to use. Why it's not designed to select the correct codec is beyond me.

@msarahan
Copy link
Contributor

msarahan commented Jan 9, 2017

@TheBeege the code for this is menuinst. Specifically, https://github.com/ContinuumIO/menuinst/blob/master/menuinst/knownfolders.py#L168

It is trying to detect the right codec, but I might be totally wrong in how I do it. PRs welcome on menuinst.

We have also reworked the installers for the coming Anaconda 4.3 release to disallow unicode paths when installing a Python2 distribution, and to warn people about these paths with Python 3. Accented characters unfortunately just break a lot of Python 2 software, and we can't fix the entire ecosystem.

@vaibhavgupta2205
Copy link

Hi @msarahan,

I tried installing both the versions i.e 2.7 as well as 3.5 for 64 bit Windows OS. Got the following three issues in order as mentioned :-

  • Failed to create Anaconda menus
  • Failed to create Anaconda directories
  • Failed to add Anaconda to the system PATH
    Can you please help me out here by letting me know what steps exactly to follow as I am completely new to this,

@Jang-neudern
Copy link

Finally installed.

  1. I'm a Korean and using non-ASCII user name. (in Korean, not English)
    -> creating new account for my window10, user name is in English.
  2. IntelliJ, blueJ, JDK were installed.
    I still do not understand relation, but they can affect path modification or something somehow (that's what I've searched)
    -> uninstall and delete paths (you can google how to)
  3. I'm not sure path variable was too long or short enough. -> just make new account name in one alphabet 'j'.
  4. vaccine : did not turn off
    anti-malware program : did turn off.
    (I still do not know causality, I just did -_- ;;)
  5. selected user only install

Thank you all!

@Jang-neudern
Copy link

I tested several times more,

My problem was just other pre-installed programs or their paths, I think.

without a new account, without a vaccine turned off, without some kinds of modifying the length of path variable, installed.

@rmundkowsky
Copy link

rmundkowsky commented Feb 4, 2017

Had this problem with Miniconda (latest I think 4.3.0) and Anaconda 4.3.0 on Windows 8.1 (64 bit, default USA English). The failure happens near end of install of these apps, so do not try to install Anaconda, because it just takes longer to fail. Making your path short, installing as Admin, installing Visual Studio redist executables, and using 32 bit rather than 64 bit version does NOT help. The following does work:

  1. ****** UNINSTALL ALL PYTHON INSTALLATIONS, OTHERWISE THEY WILL GET MESSED UP AND YOU CANNOT CLEANLY UNINSTALL THEM WITHOUT WINDOWS RESTORE, or at least I think these two problems were related *****
  2. Install Miniconda
  3. As Admin open CMD and change to directory where Miniconda is installed
  4. pythonw.exe -E -s "Lib_nsis.py" addpath
  5. pythonw.exe -E -s "Lib_nsis.py" mkdirs
  6. pythonw.exe -E -s "Lib_nsis.py" mkmenus
  7. exit that CMD
  8. I then ran Anaconda prompt from start menu, but you likely can use CMD
    note) if you run "conda list", you will see no packages installed, but good news is conda will install pacakges, so:
  9. conda install numpy
    note) this will install conda! lol
  10. conda install anaconda

Now, I am not sure if environment is totally fixed, because if you run the following it fails, but likely a different bug:
modules('help')
But if you run some tests like following it seems to work
import numpy
numpy.test('full')

So Anaconda developers, please fix this.

@sayingu
Copy link

sayingu commented Feb 7, 2017

I had a same problem at this line

Creating Anaconda menus...
Execute: "C:\Users\sayin\Anaconda3\pythonw.exe" -E -s "C:\Users\sayin\Anaconda3\Lib_nsis.py" mkmenus

I deleted user variable Path C:\Program Files (x86)\Google\google_appengine\ and it's worked.

And I guess Miniconda don't have this issue.
Because I have installed no errors same settings at my home.

@11leven
Copy link

11leven commented Mar 2, 2017

For win10 , Abort the installation when you see "Failed to create ( add ) Anaconda menus "

Restart the installation by right clicking the installation file and 'Run as Admin'.
Allow it to access by all users of the system.

@cvredenburgh
Copy link

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
Copy link

ghost commented Nov 5, 2017

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
Copy link

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
Copy link

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
Copy link

anaconda

This is the error im facing.. Please help

@goanpeca
Copy link

@larssonbajra please open a new issue

@jtcours
Copy link

jtcours commented Nov 30, 2017

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
Copy link

msrkp commented Dec 9, 2017

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
Copy link

prihu commented Dec 18, 2017

@msrkp
Copy link

msrkp commented Jan 2, 2018

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:)

  1. 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
Copy link

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

@ImmortalSon
Copy link

ImmortalSon commented Feb 21, 2018

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
Copy link

alexeiz commented Mar 10, 2018

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
Copy link

jetilton commented Apr 2, 2018

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
Copy link

mars0925 commented Apr 4, 2018

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

@yhling
Copy link

yhling commented Apr 4, 2018

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
Copy link

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

@akhilachitluri
Copy link

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

@bbakk14
Copy link

bbakk14 commented Oct 31, 2018

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
Copy link

@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
Copy link

bbakk14 commented Nov 12, 2018

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

@SandeepShaw2017
Copy link

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
Copy link

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
Copy link

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

@diegormsouza
Copy link

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
Copy link

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

@vxfranky
Copy link

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

@piyushshahu
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests