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

IJulia Installation Fails on Windows because ipykernel is not Installed #739

Closed
Kilo19 opened this issue Sep 7, 2018 · 35 comments
Closed

Comments

@Kilo19
Copy link

Kilo19 commented Sep 7, 2018

I'm running Windows 10 1803. I tried to install IJulia with Julia 0.7.0 as well as 1.0.0 and both failed. Julia tries to intsall miniconda and tries to invoke the bundled Jupyter but could not find the Python executable. C:%homepath%.julia\packages\IJulia\k5o7j\deps\build.log says:

Downloading and Extracting Packages
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... failed

ERROR conda.core.link:_execute(502): An error occurred while installing package 'defaults::ipykernel-4.9.0-py37_0'.
LinkError: post-link script failed for package defaults::ipykernel-4.9.0-py37_0
running your command again with `-v` will provide additional information
location of failed script: C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>

And then an ugly mess of exceptions:

[ Info: Installing Jupyter via the Conda package.
[ Info: Running `conda install -y jupyter` in root environment
ERROR: LoadError: failed process: Process(setenv(`'C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\Scripts\conda.exe' install -y jupyter`,["USERDOMAIN_ROAMINGPROFILE=LAPTOP-JVG6JNHK", "ConEmuCfgDir=C:\\tools\\cmder\\vendor\\conemu-maximus5", "HOMEPATH=\\Users\\K19", "ConEmuBaseDir=C:\\tools\\cmder\\vendor\\conemu-maximus5\\ConEmu", "ChocolateyLastPathUpdate=Fri Aug 31 16:15:31 2018", "CMDER_ROOT=C:\\tools\\cmder", "ProgramData=C:\\ProgramData", "ProgramW6432=C:\\Program Files", "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", "SESSIONNAME=Console", "APPDATA=C:\\Users\\K19\\AppData\\Roaming", "ConEmuDir=C:\\tools\\cmder\\vendor\\conemu-maximus5", "ConEmuBuild=180206", "PUBLIC=C:\\Users\\Public", "ChocolateyToolsLocation=C:\\tools", "USERDOMAIN=LAPTOP-JVG6JNHK", "LM_LICENSE_FILE=C:\\flexlm\\License.dat", "OS=Windows_NT", "PROCESSOR_REVISION=8e0a", "TMP=C:\\Users\\K19\\AppData\\Local\\Temp", "ALLUSERSPROFILE=C:\\ProgramData", "Path=C:\\tools\\cmder\\vendor\\conemu-maximus5\\ConEmu\\Scripts;C:\\tools\\cmder\\vendor\\conemu-maximus5;C:\\tools\\cmder\\vendor\\conemu-maximus5\\ConEmu;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\ProgramData\\chocolatey\\bin;C:\\Users\\K19\\Dropbox\\~Shortcuts;C:\\Program Files\\PuTTY\\;C:\\ProgramData\\chocolatey\\lib\\mpv.install\\tools;C:\\tools\\NirLauncher\\Nirsoft;C:\\Users\\K19\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\K19\\AppData\\Local\\atom\\bin;C:\\tools\\cmder;C:\\Program Files\\MKVToolNix;C:\\Program Files\\Oracle\\VirtualBox;C:\\Users\\K19\\Dropbox\\~Shortcuts", "COMPUTERNAME=LAPTOP-JVG6JNHK", "ConEmuHWND=0x00040634", "USERNAME=K19", "CommonProgramFiles(x86)=C:\\Program Files (x86)\\Common Files", "CommonProgramFiles=C:\\Program Files\\Common Files", "CONDARC=C:\\Users\\K19\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\condarc-julia.yml", "ConEmuBackHWND=0x0004065E", "ConEmuBaseDirShort=C:\\tools\\cmder\\vendor\\conemu-maximus5\\ConEmu", "ConEmuPalette=Monokai", "USERPROFILE=C:\\Users\\K19", "PSModulePath=C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules", "PROCESSOR_LEVEL=6", "=C:=C:\\Users\\K19\\.julia\\packages\\IJulia\\k5o7j\\deps", "SystemDrive=C:", "HOMEDRIVE=C:", "TEMP=C:\\Users\\K19\\AppData\\Local\\Temp", "PYTHONIOENCODING=UTF-8", "ConEmuServerPID=6768", "LOCALAPPDATA=C:\\Users\\K19\\AppData\\Local", "PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel", "DriverData=C:\\Windows\\System32\\Drivers\\DriverData", "NUMBER_OF_PROCESSORS=8", "ConEmuConfig=", "ConEmuWorkDir=C:\\Users\\K19\\AppData\\Local\\Julia-1.0.0", "PREFIX=C:\\Users\\K19\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\pkgs\\python-3.7.0-hea74fb7_0", "=::=::\\", "ComSpec=C:\\Windows\\system32\\cmd.exe", "ConEmuANSI=ON", "SystemRoot=C:\\Windows", "OneDrive=C:\\Users\\K19\\OneDrive", "ConEmuPID=2840", "ANSICON=101x1000 (101x29)", "ANSICON_DEF=7", "ConEmuHooks=Enabled", "VBOX_MSI_INSTALL_PATH=C:\\Program Files\\Oracle\\VirtualBox\\", "ProgramFiles(x86)=C:\\Program Files (x86)", "ConEmuDrawHWND=0x0005063C", "ChocolateyInstall=C:\\ProgramData\\chocolatey", "ConEmuWorkDrive=C:", "LOGONSERVER=\\\\LAPTOP-JVG6JNHK", "ConEmuAnsiLog=", "CONDA_PREFIX=C:\\Users\\K19\\.julia\\packages\\Conda\\m7vem\\deps\\usr", "windir=C:\\Windows", "FPS_BROWSER_USER_PROFILE_STRING=Default", "configsetroot=C:\\Windows\\ConfigSetRoot", "ConEmuArgs2=", "JULIA_LOAD_PATH=@;C:\\Users\\K19\\AppData\\Local\\Temp\\jl_3F58.tmp", "CommonProgramW6432=C:\\Program Files\\Common Files", "ProgramFiles=C:\\Program Files", "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer", "ConEmuDrive=C:", "PROCESSOR_ARCHITECTURE=AMD64", "OPENBLAS_MAIN_FREE=1", "ConEmuArgs=/Icon \"C:\\tools\\cmder\\icons\\cmder.ico\" /Title Cmder /dir \"C:\\Users\\K19\""]), ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
 [2] pipeline_error at .\process.jl:695 [inlined]
 [3] #run#505(::Bool, ::Function, ::Cmd) at .\process.jl:653
 [4] run at .\process.jl:651 [inlined]
 [5] macro expansion at .\logging.jl:307 [inlined]
 [6] runconda(::Cmd, ::String) at C:\Users\K19\.julia\packages\Conda\m7vem\src\Conda.jl:112
 [7] add at C:\Users\K19\.julia\packages\Conda\m7vem\src\Conda.jl:174 [inlined] (repeats 2 times)
 [8] top-level scope at logging.jl:311
 [9] top-level scope at C:\Users\K19\.julia\packages\IJulia\k5o7j\deps\build.jl:38
 [10] include at .\boot.jl:317 [inlined]
 [11] include_relative(::Module, ::String) at .\loading.jl:1038
 [12] include(::Module, ::String) at .\sysimg.jl:29
 [13] include(::String) at .\client.jl:388
 [14] top-level scope at none:0
in expression starting at C:\Users\K19\.julia\packages\IJulia\k5o7j\deps\build.jl:9

I looked at the script that failed:

@echo off

:: Install kernelspec at post-link because conda doesn't substitute Windows paths correctly in JSON files
"%PREFIX%\python.exe" -m ipykernel install --sys-prefix > NUL 2>&1 && if errorlevel 1 exit 1

However, %PREFIX% is not defined on my system. I manually added PREFIX as a system enviornment variable that points to the folder of the Python executable from miniconda (in my case C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\python-3.7.0-hea74fb7_0)
and ran refreshenv.

I compiled IJulia again using Pkg.build("IJulia") and it failed again. I ran the aforementioned script again, and it tells me that "No module named ipykernel".

I don't know if IJulia is at fault but since I encountered this problem while installing IJulia I'll submit my issue here. Feel free to point me to other places.

@stevengj
Copy link
Member

stevengj commented Sep 7, 2018

IJulia is not the source of the problem here — the initial error is the post-link script failed problem, which is a problem with the Anaconda installer. If you google this issue, you will find two related discussions:

In Julia, try

using Conda
Conda.runconda(`update -y conda`)
Conda.runconda(`update -y ipykernel`)
Conda.runconda(`update -y --all`)

Does that fix the problem?

Another issue where a similar error is reported is

where the problem was "out of date ActiveState 2.7 install" and the solution was to remove %USERPROFILE%/AppData/Roaming/Python/Python27/site-packages

@Kilo19
Copy link
Author

Kilo19 commented Sep 7, 2018

Sorry I accidentally deleted my previous comment -_-.
If I run conda then it says:

Unable to create process using 'C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\conda-4.5.11-py37_0\python.exe C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\conda-4.5.11-py37_0\Scripts\conda-script.py '

That is not where my Python executable is at. How can I tell conda to use something else?

@Kilo19
Copy link
Author

Kilo19 commented Sep 7, 2018

Running the series of conda commands in Julia gives:

julia> using Conda
ERROR: ArgumentError: Package Conda not found in current path:
- Run `Pkg.add("Conda")` to install the Conda package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:817

(v1.0) pkg> Pkg.add("Conda")
ERROR: expected command. instead got [Pkg.add(]

julia> Pkg.add("Conda")
  Updating registry at `C:\Users\K19\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `C:\Users\K19\.julia\environments\v1.0\Project.toml`
  [8f4d0f93] + Conda v1.0.1
  Updating `C:\Users\K19\.julia\environments\v1.0\Manifest.toml`
 [no changes]

julia> using Conda

julia> Conda.runconda(`update -y conda`)
[ Info: Running `conda update -y conda` in root environment
Solving environment: done

# All requested packages already installed.

julia> Conda.runconda(`update -y ipykernel`)
[ Info: Running `conda update -y ipykernel` in root environment

PackageNotInstalledError: Package is not installed in prefix.
  prefix: C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr
  package name: ipykernel

julia> Conda.runconda(`update -y ipykernel`)
[ Info: Running `conda update -y ipykernel` in root environment

PackageNotInstalledError: Package is not installed in prefix.
  prefix: C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr
  package name: ipykernel


ERROR: failed process: ...

Manually feeding the right path gives:

C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\python-3.7.0-hea74fb7_0\python.exe C:\Users \K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\conda-4.5.11-py37_0\Scripts\conda-script.py
Traceback (most recent call last):
  File "C:\Users\K19\.julia\packages\Conda\m7vem\deps\usr\pkgs\conda-4.5.11-py37_0\Scripts\conda-script.py", line 6, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'

EDIT: adding PYTHONPATH myself made the manual way to work. I'm surprised for all the missing environment variables. But I still need conda to work with Julia.

@Kilo19
Copy link
Author

Kilo19 commented Sep 7, 2018

Are there other environment variables that conda looks at? I can manually add them.

@masuday
Copy link

masuday commented Sep 7, 2018

I have the same problem in Windows 7 and Julia 0.7/1.0.
@Kilo19 Could you tell me which specific directory I have to add to PYTHONPATH in this case?

@stevengj
Copy link
Member

stevengj commented Sep 7, 2018

What did you need the "right path" for? The error indicates that ipykernel is not installed, so of course subsequent commands didn't work.

You could explicitly try to add it again with Conda.add("ipykernel"), but I'm guessing you'll get the post-link script failed message again. In which case it is probably not the problem described in conda/conda#6286

It could be the conda/conda#7351 problem, where it is some old installation that is messing things up?

@Kilo19
Copy link
Author

Kilo19 commented Sep 7, 2018

I found the fix #363 (comment) . With this ENV set I need no other tricks. I think the README is wrong. It says setting ENV["JUPYTER"]="" on Linux forces Pkg.add() to use Conda (but it is the default on Mac and Windows so you don't need to set it on those two OSes). However, even with all other versions of Python nuked, if I don't set that ENV on Windows, I get screwed. This is not how I solved my problem.

@Kilo19
Copy link
Author

Kilo19 commented Sep 7, 2018

The trick only worked for my desktop though, which is running the up-to-date version of Windows 10 Education. My laptop is running Windows 10 Pro 1803.

@stevengj
Copy link
Member

stevengj commented Sep 8, 2018

@Kilo19, your suggestion to use ENV["JUPYTER"]="" makes no sense to me — this is already the default on Windows. Unless for some reason you had already set this environment variable?

Furthermore, your original error output included Installing Jupyter via the Conda package, so it seems clear that it was already using Conda.

Can you clarify what changed?

@stevengj
Copy link
Member

stevengj commented Sep 8, 2018

One of my students indicated that a workaround was to force Conda to install Python 2, as apparently only the Python 3 version of ipywidgets is causing the problem on Windows. To do this, you can do:

using Conda #  you may need to "add Conda" at the pkg prompt first
rm(Conda.ROOTENV, recursive=true) # remove your existing Conda installation
ENV["CONDA_JL_VERSION"]="2"
Pkg.build("IJulia")  # re-install jupyter

In the long run, however, it would be good to figure out what is going on and file a proper bug report to the anaconda folks.

It would be very helpful if an experienced developer with Windows could reproduce this problem and give a more detailed analysis. @tkelman or @ChrisRackauckas?

@tkelman
Copy link
Contributor

tkelman commented Sep 8, 2018

The difference between py2 and py3 is that py3 treats empty directories as namespace packages, so you get something other than an ImportError and all the typical conditional dependency try-catch python code doesn't work right. conda isn't very careful about ensuring removed packages are all the way deleted, so if you have a slow filesystem (made worse by aggressive antivirus) then the python imports triggered during this post-link script may fail. I thought one of the packages in this chain (jedi maybe?) fixed the conditional dependency fragility for a recent release, but perhaps it's back. If this is happening in a clean from-scratch install then something else might be up. Debugging is made trickier by the post-link scripts suppressing error output. Should be reproducible without involving julia though, it's a conda issue not an IJulia one.

@stevengj
Copy link
Member

stevengj commented Sep 8, 2018

Thanks @tkelman, this is happening in clean from-scratch installs as of this week. It would be great if you can help file a conda issue.

@Kilo19
Copy link
Author

Kilo19 commented Sep 8, 2018

@tkelman I'm running Sandisk CloudSpeed Ultra Gen II on my laptop. My desktop uses Toshiba XG3. If my FS is slow enough to cause the issue then think about all the poor guys still running spinning rust as their boot drives. Regarding py2 and py3, my desktop has 2.7, 3.6.5 32-bit, and 3.6.5 64-bit before and after installing Julia-related things (all directly from python.org, no bundled distributions like Anaconda), and IJulia installed the newest Miniconda 3 64-bit. My place has some slow connection right now. I'll try the suggestion from @stevengj later. I might also fire up a bunch of VMs to experiment. Worst comes to worst I'll run a Linux VM on my laptop as a temporary workaround.

@tkelman
Copy link
Contributor

tkelman commented Sep 8, 2018

If someone can reproducibly go from a clean fresh miniconda to a conda call that triggers the error, that's enough for a conda bug report or adding to the existing one. Modifying the post-link script so it stops redirecting output can be useful to see exactly where the error is happening. I also think I have a pull request open on conda-forge's ipykernel that drops the post-link script since I think it's not necessary any more, which would eventually make it into the anacondarecipes default channel if it were merged.

@grpineiro
Copy link

try:
conda install ipykernel
and try again:
Pkg.build("IJulia")

@Kilo19
Copy link
Author

Kilo19 commented Sep 9, 2018

I got around the issue by installing jupyter on vanilla python with pip and point ENV["JUPYTER"] to it. I tried installing Anaconda myself as well but the newest version of Anaconda would not work because the relative location between jupyter.exe and python.exe for Anaconda is different from installing jupyter on vanilla python.
python.exe is one folder above jupyter on vanilla:

"C:\Program Files\Python37\Scripts\jupyter.exe"
"C:\Program Files\Python37\python.exe"

That is not true for Anaconda3-5.2.0-Windows-x86_64:

"C:\Users\K19\Anaconda3\pkgs\jupyter_core-4.4.0-py36h56e9d50_0\Scripts\jupyter.exe"
"C:\Users\K19\Anaconda3\pkgs\python-3.6.5-h0c2934d_0\python.exe"

@stevengj
Copy link
Member

stevengj commented Sep 10, 2018

@Kilo19, why does the relative location of jupyter.exe and python.exe matter? I thought in Anaconda you don't normally run things directly out of the pkgs directory, and instead there is a global bin and/or Scripts directory? i.e. isn't there a "C:\Users\K19\Anaconda3\Scripts\jupyter.exe"?

@Kilo19
Copy link
Author

Kilo19 commented Sep 10, 2018

@stevengj That's what I thought. But apparently when IJulia tries to detect presence of jupyter it wants to use python.exe one level above ENV["JUPYTER"] to execute jupyter-script.py that's in the same folder as ENV["JUPYTER"]. That's the first thing it failed in my log. After that it tries to install its miniconda and I got the same error.

@stevengj
Copy link
Member

stevengj commented Sep 10, 2018

Julia just runs $JUPYTER — it is the jupyter.exe file itself that decides where it wants to look for python.exe. Does running C:\Users\K19\Anaconda3\pkgs\jupyter_core-4.4.0-py36h56e9d50_0\Scripts\jupyter.exe in your terminal work?

And, as I said, it looks wrong to me that you are supplying the jupyter.exe path from the pkgs directory. Isn't there a "C:\Users\K19\Anaconda3\Scripts\jupyter.exe"?

(Note that all of this has nothing to do with the original issue.)

@Kilo19
Copy link
Author

Kilo19 commented Sep 10, 2018

@stevengj Just found that I had to use the one under C:\Users\K19\Anaconda3\Scripts. The one in pkgs is bad. I usually rely on everything search tool to find files. In this case the program did not pick up the one in Scripts so I thought the one in pkgs was the one to use because only that one showed up. Turns out those executables in Scripts are hardlinks and therefore the search tool did not enumerate them and instead only found the target file (USN journals do not support hardlinks very well, but soft links are fine). This is a dumb mistake, but could someone update the README to clarify which one to use?

@JDB17
Copy link

JDB17 commented Sep 11, 2018

I have had the same problem (Windows 10, Julia 0.7). I played around with different Anaconda settings without success).

It seems like IJulia is just not working with Julia 0.7 and 1.0 at the moment (#693).

I now installed 0.6.4 and IJulia is working smoothly, so far.

@stevengj
Copy link
Member

No, #693 is fixed.

Did you try my suggestion (#739 (comment)) of telling Conda.jl to use Python 2?

@Ynkneed
Copy link

Ynkneed commented Sep 14, 2018

Dear stevengj, #739 worked for me. I was having the same error message as Kilo19 in his first post.

I'm using Windows 7 and Julia 1.0.

Not really sure yet what will I be missing by using Py2 instead of Py3 but Thank You very much for the tip.

stevengj added a commit to mitmath/julia-mit that referenced this issue Sep 14, 2018
@masuday
Copy link

masuday commented Sep 15, 2018

Just a report: the suggestion #739 (comment) perfectly works to me for Julia 0.7/1.0 on Windows 7/10.

Thank you for the solution.

@vioxcd
Copy link

vioxcd commented Sep 16, 2018

Windows 10 with Julia 1.0 here. #739 (comment) works for me too. Thanks!

@stevengj
Copy link
Member

stevengj commented Sep 18, 2018

Could one of the Windows users please do a minimal test to reproduce without involving Julia, and then file a bug report with Anaconda? Steps should be something like:

  1. Download miniconda installer: https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe
  2. Run the installer Miniconda3-latest-Windows-x86_64.exe /S /AddToPath=0 /RegisterPython=0 /D=SOMEDIR where SOMEDIR is some temporary directory that you want to use for testing this.
  3. Run conda config --add channels defaults --force and conda update -y conda for the SOMEDIR installation.
  4. Run conda install -y jupyter — this should produce the error about ipykernel

Assuming this (or something similar) reproduces the error, file a bug report at https://github.com/ContinuumIO/anaconda-issues

@masuday
Copy link

masuday commented Sep 18, 2018

I reproduced this issue on Windows 7 as you suggested in #739 (comment). I will file a bug report.

@tkelman
Copy link
Contributor

tkelman commented Sep 19, 2018

Fixed upstream, you should be able to close this

@masuday
Copy link

masuday commented Sep 19, 2018

EDIT: I updated the report.

I think the issue is not solved yet. A fresh installation of Jupyter in the latest Miniconda3 (#739 (comment)) still fails with a different error. Precisely, the installation ends with the following message.

Preparing transaction: done
Verifying transaction: done
Executing transaction: / DEBUG menuinst_win32:__init__(196): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'c:\fresh_miniconda3', env_name: 'None', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(320): Shortcut cmd is c:\fresh_miniconda3\python.exe, args are ['c:\\fresh_miniconda3\\cwp.py', 'c:\\fresh_miniconda3', 'c:\\fresh_miniconda3\\python.exe', 'c:\\fresh_miniconda3\\Scripts\\jupyter-notebook-script.py', '%USERPROFILE%']
done

And when I type jupyter notebook on the shell (cmd.exe), I got:

c:\fresh_miniconda3\Scripts>jupyter notebook
_cffi_ext.c
c:\fresh_miniconda3\lib\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(213): fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
Traceback (most recent call last):
  File "c:\fresh_miniconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "c:\fresh_miniconda3\lib\site-packages\notebook\notebookapp.py", line 46, in <module>
    from zmq.eventloop import ioloop
  File "c:\fresh_miniconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "c:\fresh_miniconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "c:\fresh_miniconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "c:\fresh_miniconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "c:\fresh_miniconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "c:\fresh_miniconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.

I also tried add IJulia in a newly installed Julia 0.7 and it gave an error.

│ Downloading and Extracting Packages
│ Preparing transaction: ...working... done
│ Verifying transaction: ...working... done
│ Executing transaction: ...working...
│ DEBUG menuinst_win32:__init__(196): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr', env_name: 'None', mode: 'user', used_mode: 'user'
│ DEBUG menuinst_win32:create(320): Shortcut cmd is C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\python.exe, args are ['C:\\Users\\yutaka\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\cwp.py', 'C:\\Users\\yutaka\\.julia\\packages\\Conda\\m7vem\\deps\\usr', 'C:\\Users\\yutaka\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\python.exe', 'C:\\Users\\yutaka\\.julia\\packages\\Conda\\m7vem\\deps\\usr\\Scripts\\jupyter-notebook-script.py', '%USERPROFILE%']
│ done
│ Error executing Jupyter command 'kernelspec': [Errno 'jupyter-kernelspec' not found] 2
│ _cffi_ext.c
│ C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(213): fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
│ Traceback (most recent call last):
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\Scripts\jupyter-kernelspec-script.py", line 6, in <module>
│     from jupyter_client.kernelspecapp import KernelSpecApp
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
│     from .connect import *
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\jupyter_client\connect.py", line 23, in <module>
│     import zmq
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\__init__.py", line 47, in <module>
│     from zmq import backend
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
│     reraise(*exc_info)
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
│     raise value
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
│     _ns = select_backend(first)
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
│     mod = __import__(name, fromlist=public_api)
│   File "C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
│     from . import (constants, error, message, context,
│ ImportError: DLL load failed: The specified module could not be found.
│ [ Info: Installing Jupyter via the Conda package.
│ [ Info: Downloading miniconda installer ...
│ [ Info: Installing miniconda ...
│ [ Info: Running `conda config --add channels defaults --force` in root environment
│ [ Info: Running `conda update -y conda` in root environment
│ [ Info: Running `conda install -y jupyter` in root environment
│ [ Info: Found Jupyter version 4.4.0: C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\Scripts\jupyter
│ [ Info: Installing Julia kernelspec julia-0.7
│ ERROR: LoadError: failed process: Process(`'C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\python.exe' 'C:\Users\yutaka\.julia\packages\Conda\m7vem\deps\usr\Scripts\jupyter-kernelspec-script.py' install --replace --user 'C:\Users\yutaka\AppData\Local\Temp\julia-0.7'`, ProcessExited(1)) [1]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
│  [2] pipeline_error at .\process.jl:712 [inlined]
│  [3] #run#509(::Bool, ::Function, ::Cmd) at .\process.jl:670
│  [4] run at .\process.jl:668 [inlined]
│  [5] #installkernel#4(::String, ::Function, ::String) at C:\Users\yutaka\.julia\packages\IJulia\k5o7j\deps\kspec.jl:85│  [6] installkernel(::String) at C:\Users\yutaka\.julia\packages\IJulia\k5o7j\deps\kspec.jl:36
│  [7] top-level scope at logging.jl:310
│  [8] top-level scope at logging.jl:309
│  [9] top-level scope at C:\Users\yutaka\.julia\packages\IJulia\k5o7j\deps\build.jl:38
│  [10] include at .\boot.jl:317 [inlined]
│  [11] include_relative(::Module, ::String) at .\loading.jl:1038
│  [12] include(::Module, ::String) at .\sysimg.jl:29
│  [13] include(::String) at .\client.jl:398
│  [14] top-level scope at none:0
│ in expression starting at C:\Users\yutaka\.julia\packages\IJulia\k5o7j\deps\build.jl:9
│
│ Full log at C:\Users\yutaka\.julia\packages\IJulia\k5o7j\deps\build.log
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:1068

In the upstream, the discussion continues. Unfortunately, I am not really sure what is actually discussed there.

@tkelman
Copy link
Contributor

tkelman commented Sep 19, 2018

That's not an error. Some conda packages create start-menu shortcuts, and for whatever reason they're a bit noisy in doing so. I'd rather have a little bit of harmless output once in a while than silence real errors (like that > NUL redirection in the post-link script is doing, which was hiding the error initially).

@masuday
Copy link

masuday commented Sep 19, 2018

@tkelman Probably we are chatting. But I got an error; please see my comment above that I just edited.

@tkelman
Copy link
Contributor

tkelman commented Sep 19, 2018

Gotcha, the errors look like they have the same root cause. Basically conda's been patching their python to do some ugly things to PATH all this time, and they finally got rid of that patch for 3.7. So for external programs to call into conda's python now in a way that needs to load any conda-sourced libraries, they'll need to activate the conda environment first.

@masuday
Copy link

masuday commented Sep 19, 2018

@tkelman Thank you for your comment! Probably I have to wait for the next release. I am happy to test the new one.

@masuday
Copy link

masuday commented Sep 23, 2018

Just a report. This issue is fixed with the latest Conda.jl in the master branch. It was originally caused by the behavior change in the latest Miniconda3 (4.5.11 Python 3.7) and Canda.jl should take care of it (JuliaPy/Conda.jl#125).

EDIT: For now, there are two solutions to this issue: 1) to use Python 2 as in #739 (comment), or 2) to install the latest Conda.jl in the master branch. I would like to keep this Issue open until a Windows user can install IJulia without any additional operations to control dependent packages.

@tkf
Copy link
Member

tkf commented Sep 23, 2018

I also mentioned in https://discourse.julialang.org/t/trouble-installing-ijulia-in-fresh-julia-1-0/15244/6?u=tkf but just running Conda.add("python=3.6") could be the simplest solution for those who already installed Conda.jl without any configuration. I never tested it though. (This is supposed to install Python 3.6 in the base environment. It relies on the ability for conda command to self-mutate its own environment.)

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

9 participants