Giter VIP home page Giter VIP logo

icsharp's Introduction

Build Status

Interactive C# Notebook

ICSharp is an C# language kernel for Jupyter. It allows users to use Jupyter's Notebook frontend, except where Jupyter executes python code, ICSharp can execute C# code. It is based on Roslyn REPL engine of scriptcs., so all the goodies of scriptcs comes along with it.

This is on top of all of Jupyter's other frontend features like Markdown rendering, HTML rendering, saving notebooks for later use and even the ability to view ICSharp Notebooks in Jupyter's NBViewer.

Disclaimer

The development of this language kernel for C# is at it's very early stages. This is Alpha. Take with a large pinch of salt :)

Installation

Feedback

I am eager to receive feedback from anyone who has attempted to use ICSharp. I would love to hear some thoughts on how to improve ICSharp.

Known Issues

  • Console.WriteLine does not print output in the notebook
  • Console.ReadLine does not work currently

Contributors

Thanks to contributors (in alphabetic order).

icsharp's People

Contributors

apskim avatar den-run-ai avatar filmor avatar gabrielgt avatar handflucht avatar minrk avatar thomasjm avatar wildart avatar zabirauf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icsharp's Issues

Built failed in VS2017

I followed the instruction on https://github.com/zabirauf/icsharp/wiki/Installation to install this package. The package cannot be built in VS2017.

Following are the output in the process:

C:\Download>git clone --recursive https://github.com/zabirauf/icsharp
Cloning into 'icsharp'...
remote: Counting objects: 367, done.
remote: Total 367 (delta 0), reused 0 (delta 0), pack-reused 367
Receiving objects: 100% (367/367), 1.78 MiB | 679.00 KiB/s, done.
Resolving deltas: 100% (211/211), done.
Submodule 'Engine' (https://github.com/scriptcs/scriptcs.git) registered for path 'Engine'
Cloning into '/c/Download/icsharp/Engine'...
remote: Counting objects: 14014, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 14014 (delta 0), reused 0 (delta 0), pack-reused 14010
Receiving objects: 100% (14014/14014), 22.35 MiB | 1.01 MiB/s, done.
Resolving deltas: 100% (9529/9529), done.
Submodule path 'Engine': checked out 'ceb8443df52ae872a125832a3d89a13b00cd2b54'

Build solution:

Severity Code Description Project File Line Suppression State
Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packages\StyleCop.MSBuild.4.7.50.0\build\StyleCop.MSBuild.Targets. ScriptCs (ScriptCS\ScriptCs) C:\Download\icsharp\Engine\src\ScriptCs\ScriptCs.csproj 178
Error This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets. ScriptCs.Contracts C:\Download\icsharp\Engine\src\ScriptCs.Contracts\ScriptCs.Contracts.csproj 129
Error This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets. ScriptCs.Core C:\Download\icsharp\Engine\src\ScriptCs.Core\ScriptCs.Core.csproj 124
Error This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets. ScriptCs.Hosting C:\Download\icsharp\Engine\src\ScriptCs.Hosting\ScriptCs.Hosting.csproj 130

Do a nuget restore:

All packages are already installed and there is nothing to restore.
Time Elapsed: 00:00:00.0458248
========== Finished ==========

What should I do from here?

Support for Jupyter Lab

I could successfully install ICSharp in Jupyter notebook in both Windows 10 Home and Linux docker container and able to run the sample notebook (iCSharp Sample.ipynb).

After I installed Jupyter Lab, I can see that it somehow recognizes the kernel, because there is an option to start a notebook with C# kernel. When I select that option, the kernel json file content is display in the console:

2018/06/15 16:48:08:414 [DEBUG] Hello2
2018/06/15 16:48:08:421 [DEBUG] C:\Users\Alex\AppData\Roaming\jupyter\runtime\kernel-b9abf7cf-2f77-4b6f-973e-76ee2344f684.json
2018/06/15 16:48:08:428 [INFO]  Opening file C:\Users\Alex\AppData\Roaming\jupyter\runtime\kernel-b9abf7cf-2f77-4b6f-973e-76ee2344f684.json
2018/06/15 16:48:08:428 [DEBUG] {
  "shell_port": 64747,
  "iopub_port": 64748,
  "stdin_port": 64749,
  "control_port": 64750,
  "hb_port": 64751,
  "ip": "127.0.0.1",
  "key": "1bda1ee9-8192f31157878617edb9fca3",
  "transport": "tcp",
  "signature_scheme": "hmac-sha256",
  "kernel_name": "csharp"
}

shot

What changes should we make so that jupyter lab cell evaluate C# code?

outgoing wire protocol - signing messages.

on mono messages received by notebook throw errors because the hash field of the
wire message is empty. Instead it should be signed with HMAC digests.

Message signing is easy to do; .net libraries support this out of the box.
I can write the signing part, what I am unclear of is:

  1. jupyter notebook --help-all
    It appears that default behavior is not to sign anything, so why is it now wanting wire to be signed.
    There should be an off switch

  2. What is the parameter to pass to jupyter in the commandline, to give it the public key
    that ICShwarp would use.

  3. does this happen on mono only or also with latest Jupyter version on windows/
    If it happens only on mono, then the relevant Cryptography libraries on mono are missing.
    I know that mono misses some of the .net libraries.

  4. We should know precisely which data is fed into the HMAC function, because different
    line separators or spaces might fuck up the signing.
    IPython's example:
    digester = HMAC(key, digestmod=hashlib.sha256)

    for each message

    d = digester.copy()
    for serialized_dict in (header, parent, metadata, content):
    d.update(serialized_dict)
    signature = d.hexdigest()

For Implementation I would use is this :

using System.Security.Cryptography;
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
HMACSHA256 hmac = new HMACSHA256(key))

Loading a x64 dll

Hi, thanks for this integration with ipython, it's really nice.

I can't load dll compiled as 'x64'.
The error I receive is AssemblyLoader failed to load assembly xxx.xxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

I tried with the same dll at the same location compiled in 'x86' and in 'AnyCpu' and it works.

Is the kernel launched in a 32-bit mode ?
Is it possible to launch it in x64 ?

Add to list of project using IPython.

Hi,

There is an informal list of IPython/Jupyter compatible kernel over there, its a wiki, so you can edit, we'll be happy to have you listed here.

Also feel free to announce on IPython mailing list !

iCSharp with mono support using Docker

I think icsharp shoud ideally run on a linux server and have a simple docker container that allows to play around quickly.

I want to share my progress; I havent had complete success yet.

This project has a dockerimage that installs on debian jessie the current jupyter version (via anaconda) the current mono version (via debian contrib):
https://github.com/awb99/anaconda-notebook

To compile icsharp I had to do a couple of things:

  1. The dependency csscript does not compile in the old verson, so I have to upgrade to the current master:
    git clone --recursive https://github.com/awb99/icsharp.git
    cd icsharp/Engine
    git checkout master
    update git pull
  2. With the latest version there are ambiguous namespace references. My fork has corrected
    some of the issues (not all)

Regards
Andreas

Kernel crashes (WindowsError)

I'm trying to get ICSharp working with the latest version of Jupyter, but the kernel keeps crashing.

After getting the same error as on Issue 36, I installed Anaconda w/ Python 2.7. Now I get a different error:

Traceback (most recent call last):
  File "D:\Utils\anaconda2\lib\site-packages\notebook\base\handlers.py", line 516, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "D:\Utils\anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\notebook\services\sessions\handlers.py", line 75, in post
    type=mtype))
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "D:\Utils\anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "D:\Utils\anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "D:\Utils\anaconda2\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "D:\Utils\anaconda2\lib\site-packages\tornado\gen.py", line 307, in wrapper
    yielded = next(result)
  File "D:\Utils\anaconda2\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 94, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "D:\Utils\anaconda2\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "D:\Utils\anaconda2\lib\site-packages\jupyter_client\manager.py", line 257, in start_kernel
    **kw)
  File "D:\Utils\anaconda2\lib\site-packages\jupyter_client\manager.py", line 203, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "D:\Utils\anaconda2\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "D:\Utils\anaconda2\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "D:\Utils\anaconda2\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Based on the source code, the error happens when Jupyter attempts to spawn a new process. It is weird because the Python 2 kernel works fine.

Console.WriteLine does not print output in the notebook

I think you can register for Console Printouts via Trace.Listener.Add.
Here is a snipped that use to display a virtual console:

    #region  HelperClass TConsoleTraceListener
    public class TConsoleTraceListener : TraceListener
    {
        #region Variables
        TConsole _parent;
        #endregion

        #region Constructor
        public TConsoleTraceListener (TConsole parent)
        {
            _parent = parent;
            //Debug.Listeners.Clear ();
            //Debug.Listeners.Add (this);
            //Trace.Listeners.Clear ();
            Trace.Listeners.Add (this);
        }
        #endregion

        #region TraceListener Overrides
        override public void Write(string message) 
        {
            try
            {
                _parent.WriteLine (message);
            }
            catch (Exception ex)
            {
                ;
                Console.Write ("Ex="+ex.Message );
            }
        }
        override public void WriteLine(string message) 
        {     
            try
            {
                _parent.WriteLine (message);
            }
            catch (Exception ex)
            {
                ;
                Console.Write ("Ex="+ex.Message );
            }
        }
        #endregion
    }
    #endregion

Unable to install on Manjaro

I followed the command as listed here

┌🤘-🐧terabyte@ 💻 h3ll - 🧱 icsharp on 🌵  master ✓
└🤘-> bash ./build.sh brew
+ mozroots --import --sync --quiet
+ mono ./.nuget/NuGet.exe restore ./iCSharp.sln
MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.
All packages listed in packages.config are already installed.
+ cd ./Engine
+ '[' brew == brew ']'
+ ./build_brew.sh
+ mozroots --import --sync --quiet
+ mono ./.nuget/NuGet.exe restore ./ScriptCs.sln
Unable to find version '1.9.2' of package 'xunit.runners'.

Checking if xUnit Installed

image

Error 1043

ubuntu 18.04
ScriptEngine/ExecutionResult.cs(26,34): error CS1043: Invalid accessor body =>', expecting ;' or `{'

setup travis CI

currently the changes to code can only be verified locally by building the VS solution. Travis CI builds would check every commit against .NET & Mono targets, plus dependencies.

FileNotFoundError When trying to run.

After installing I openned a notebook and selected csharp as the language. I saw a red button at the top saying Kernel error. I decided to click it to see what the problem was and it gave be the following error log:

Traceback (most recent call last):
  File "c:\python36\lib\site-packages\notebook\base\handlers.py", line 516, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "c:\python36\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "c:\python36\lib\site-packages\notebook\services\sessions\handlers.py", line 75, in post
    type=mtype))
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "c:\python36\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "c:\python36\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "c:\python36\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "c:\python36\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "c:\python36\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "c:\python36\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "c:\python36\lib\site-packages\tornado\gen.py", line 307, in wrapper
    yielded = next(result)
  File "c:\python36\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 94, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "c:\python36\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "c:\python36\lib\site-packages\jupyter_client\manager.py", line 257, in start_kernel
    **kw)
  File "c:\python36\lib\site-packages\jupyter_client\manager.py", line 203, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "c:\python36\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "c:\python36\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "c:\python36\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

'ScriptResult' could not be found

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'ScriptResult' could not be found (are you missing a using directive or an assembly reference?) Kernel D:\Projects\icsharp\Kernel\ScriptEngine\ReplEngineWrapper.cs 38 Active

After installed ScriptCs.Hosting and ScriptCs.Engine.Roslyn.
Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'ScriptCsArgs' could not be found (are you missing a using directive or an assembly reference?) Kernel D:\Projects\icsharp\Kernel\ReplEngineFactory.cs 112 Active

By the way, is there docs to quick start?

icsharp kernel throwing error when version header is empty

I tried installing it, had a few issues (I accidentally installed python, which is actually python3). Anyhow, in the end the install went fine.

However when I am running ipython I am getting error messages and can not make it to work :-(

What I do
ipython notebook --profile=csharp
go to the right 'New / Python 2' (I don't see any other relevant option)
It then says 'kernel starting', and then after a few seconds, in the kernel logs I get the following message below

Any idea what could be causing the issue?

Thanks!

c:\Users\joel\Desktop>ipython notebook --profile=icsharp
[I 08:49:16.538 NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 08:49:16.615 NotebookApp] Serving notebooks from local directory: c:\Users\joel\Desktop
[I 08:49:16.615 NotebookApp] 0 active kernels
[I 08:49:16.615 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 08:49:16.615 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 08:49:40.161 NotebookApp] Creating new file in
[I 08:50:07.785 NotebookApp] Saving file at /untitled.txt
[I 08:50:16.197 NotebookApp] Creating new file in
[I 08:50:31.407 NotebookApp] Creating new notebook in
C:\tools\python2\lib\site-packages\IPython\kernel\manager.py:95: UserWarning: Setting kernel_cmd is deprecated, use kernel_spec to start different kernels.  warnings.warn("Setting kernel_cmd is deprecated, use kernel_spec to "
[I 08:50:33.299 NotebookApp] Kernel started: 45886f58-6112-448b-bb0a-64c02dfbe2e1
2015/04/12 08:50:33:427 [DEBUG] Hello2
2015/04/12 08:50:33:432 [DEBUG] C:\Users\joel\.ipython\profile_icsharp\security\kernel-45886f58-6112-448b-bb0a-64c02dfbe2e1.json
2015/04/12 08:50:33:443 [INFO]  Opening file C:\Users\joel\.ipython\profile_icsharp\security\kernel-45886f58-6112-448b-bb0a-64c02dfbe2e1.json
2015/04/12 08:50:33:451 [DEBUG] {
  "stdin_port": 2645,
  "ip": "127.0.0.1",
  "control_port": 2646,
  "hb_port": 2647,
  "signature_scheme": "hmac-sha256",
  "key": "",
  "shell_port": 2643,
  "transport": "tcp",
  "iopub_port": 2644
}
[W 08:50:43.374 NotebookApp] Timeout waiting for kernel_info reply from 45886f58-6112-448b-bb0a-64c02dfbe2e1
[C 08:50:43.398 NotebookApp] Malformed message: ['<IDS|MSG>', '', '{"msg_id":"eedb2463-a30b-4f73-8501-47fa194dbe13","username":"icsharp_kernel","session":"80EC14297A7E4E558F8B41AAE3C1EED6","msg_type":"kernel_info_reply","version":""}', '{"msg_id":"DA9053AEC3EB4EDB848C34DED588C3D2","username":"username","session":"80EC14297A7E4E558F8B41AAE3C1EED6","msg_type":"kernel_info_request","version":"5.0"}', 
'{}', '{"protocol_version":"4.1","implementation":"iCsharp", "implementation_version":null,"language":"C#", "language_version":"0.0.1", "banner":null, "ipython_version":"2.0.0dev"}']

    Traceback (most recent call last):
      File "C:\tools\python2\lib\site-packages\IPython\html\base\zmqhandlers.py"
, line 181, in _on_zmq_reply
        msg = self._reserialize_reply(msg_list, channel=channel)
      File "C:\tools\python2\lib\site-packages\IPython\html\base\zmqhandlers.py"
, line 162, in _reserialize_reply
        msg = self.session.deserialize(msg_list)
      File "C:\tools\python2\lib\site-packages\IPython\kernel\zmq\session.py", l
ine 852, in deserialize
        return adapt(message)
      File "C:\tools\python2\lib\site-packages\IPython\kernel\adapter.py", line
360, in adapt
        from_version = int(header['version'].split('.')[0])
    ValueError: invalid literal for int() with base 10: ''

PermissionError: [Errno 13] Permission denied

Running on Ubuntu 16.04 I get the following kernel error when I open a C# notebook.

Kernel was installed to user:

jupyter-kernelspec install kernel-spec --user

with the following kernel.json:

{
    "argv": ["/home/userdir/stuff/icsharp/build/Release/bin/iCSharp.Kernel.exe", "{connection_file}"],
    "display_name": "C#",
    "language": "csharp"
}

This is the full error provided by clicking on the Kernel Error button:

Traceback (most recent call last):
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/web.py", line 1592, in _execute
    result = yield result
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post
    type=mtype))
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/jupyter_client/manager.py", line 259, in start_kernel
    **kw)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "/anaconda/envs/ml36/lib/python3.6/site-packages/jupyter_client/launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "/anaconda/envs/ml36/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/anaconda/envs/ml36/lib/python3.6/subprocess.py", line 1326, in _execute_child
    raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied

Not able to build with VS2015

the code public bool IsError { get => !(CompileError == null && ExecuteError == null); } in source project make my building wrong!
Here is the error:
'Error CS0161 'ExecutionResult.IsError.get': not all code paths return a value Kernel'

Unable to build

After doing a git clone, I do a build in Visual Studio 2015 update 3, and it fails to build. The error is that many of the references to packages in the build files (the csproj files) seem to assume the project is in the top level directory.

For example:

  <Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />

causes a failure, but changing that line to:

  <Import Project="$(SolutionDir)\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('$(SolutionDir)\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />

seems to fix it.

I think this is because you are pulling down ScriptCS as a git sub-project (but I'm not 100% sure if this is the reason)... and since they have installed packages in ScriptCS it isn't picking up yours correctly since it is in the wrong place.

Running for first time

Everything installed fine following the instructions in README.md

Running ipython notebook --profile=icsharp gives me:
[W 11:56:23.130 NotebookApp] Unrecognized alias: '--profile=icsharp',

And the notebook starts up but only has an options for python2 noteoboks.

Compile error due to xunit.runners

When I ran build.sh, the script crashed out because it couldn't find a given version of xunit.runners (see below). I'm running on Ubuntu 16.04, and ran the following commands:

Input:

cd ~/Codes/src
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
sudo apt-get install mono-dbg
sudo apt-get install mono-runtime-dbg
mozroots --import --machine --sync
# Asside: mono --version returned 5.10.1.20
git clone --recursive https://github.com/zabirauf/icsharp.git
cd icsharp
bash ./build.sh

Output at error:

Installed:
    17 package(s) to packages.config projects
+ cd ./Engine
+ '[' '' == brew ']'
+ ./build.sh
+ mozroots --import --sync --quiet
+ mono ./.nuget/NuGet.exe restore ./ScriptCs.sln
Unable to find version '1.9.2' of package 'xunit.runners'.

Any thoughts? I'm new to mono, so I'm still figuring out how it works.

Build script problem

I'm having a problem building ICSharp: the script Engine/build.sh contains the following command

cp src/*/bin/Release/* artifacts/Release/bin/

But when this commit gets run, it has a bunch of errors like this:

cp: will not overwrite just-created 'artifacts/Release/bin/ScriptCs.Contracts.dll' with 'src/ScriptCs.Contracts/bin/Release/ScriptCs.Contracts.dll'
cp: will not overwrite just-created 'artifacts/Release/bin/ScriptCs.Contracts.dll.mdb' with 'src/ScriptCs.Contracts/bin/Release/ScriptCs.Contracts.dll.mdb'
cp: will not overwrite just-created 'artifacts/Release/bin/Common.Logging.dll' with 'src/ScriptCs.Core/bin/Release/Common.Logging.dll'
cp: will not overwrite just-created 'artifacts/Release/bin/ScriptCs.Contracts.dll' with 'src/ScriptCs.Core/bin/Release/ScriptCs.Contracts.dll'
...

The reason is that several DLLs appear in several places, for example

src/ScriptCs/bin/Release/ScriptCs.Contracts.dll 
src/ScriptCs.Contracts/bin/Release/ScriptCs.Contracts.dll 
src/ScriptCs.Core/bin/Release/ScriptCs.Contracts.dll 
src/ScriptCs.Engine.Mono/bin/Release/ScriptCs.Contracts.dll 
src/ScriptCs.Engine.Roslyn/bin/Release/ScriptCs.Contracts.dll 
src/ScriptCs.Hosting/bin/Release/ScriptCs.Contracts.dll 

This seems like it should be straightforward to resolve but I'm not sure what the right thing to do is...

Not able to build the solution with VS2017

Hi,
I tried building it in release definition after removing the style cop. But it's failing because of logwrapper class. Please let me know how to solve this.

Thanks,
Kiran.

Suggestion: Change iCSharp.Kernel.exe.config

Additional dlls will be able to be loaded into iCSharp.Kernel.
The location of such dlls will have to be either GAC or the directory in which
iCSharp.Kernel is located.
Dotnet offers a simple way to load dlls from subdirectories. Say we have
a huge library in the subdirectory customDir1 and customDir2 then the
App.Config needs to be appended (after the startup node is closed)
with the following:

  <runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <probing privatePath="customDir1;customDir2" />
  </assemblyBinding>
  <trust level="Full" legacyCasModel="true" />
  </runtime>

Why do I suggest this? A more clear separation of the kernel from custom
third party dlls.

Note: I dont understand why the xml markup does not show above. It is there.

Is this project abandonded?

Hello. I think this is a very interesting project! Jupyter notebooks are really great! I would love to be able to use a C# kernel with a notebook. If I could load custom assemblies this would be an amazing environment for educational purposes, collaboration between developpers, scratchbooks doing analysis ... However, since the last commit on this project is more then one year ago, I wonder if this project is abandonded?

png/jpg and html tables

iPython/Jupyter supports sending back images and html markup.

One of the most useful things in using Python in Jupyter is making inline charts and nicely printing array of data classes.

This can be quite easily achieved in icsharp also. I already have written a generator that generates html and text markup for a List and either displays all columns that the given type supports, or just selective columns by an specified parameter.

Sending this data (images or html markup)back is quite easy. images are encoded as base64 and html does not need more encoding.

What we should do is this: make a new project icsharp that contains the follwing classes:

  1. MultiMediaEncoding interface. if an object is returned to icsharp that implements this interface,
    then icsharp sends the data (text/image/html/javascript) directly back to ipython jupyter.
    If users want to create their own graphical output routines, then they only need to reference this
    one library, and they are ready to o.
  2. Encoding helper classes; some simple Encoding helpers; say one Encoding Helper that encodes
    bitmaps. The encoding helpers can be registered, so they would encode certain .net
    objects automatically without further calls needed
  3. Grid Encoder (I have it, and will contribute this)

Should be all very simple to do, and I think very helpful/powerful.

Build script dependency problem

There seems to be a problem with building ICSharp from scratch in a Docker container, using Ubuntu 16.04.

I've been doing it like this:

RUN apt-get install -y mono-complete
RUN git clone --recursive https://github.com/zabirauf/icsharp.git /tools/icsharp
WORKDIR /tools/icsharp
RUN bash ./build.sh

However, this fails when running Engine/build.sh with the following error:

+ mono ./.nuget/NuGet.exe restore ./iCSharp.sln
MSBuild auto-detection: using msbuild version '14.0' from '/usr/lib/mono/xbuild/14.0/bin'.
All packages listed in packages.config are already installed.
+ cd ./Engine
+ '[' '' == brew ']'
+ ./build.sh
+ mozroots --import --sync --quiet
+ mono ./.nuget/NuGet.exe restore ./ScriptCs.sln
Unable to find version '1.9.2' of package 'xunit.runners'.

The ScriptCS submodule comes with a .nuget/NuGet.exe at version 2.8.60318.667, which is kind of old. In the past, I've worked around the problem by running bash -c "cd Engine; mono ./.nuget/NuGet.exe update -self to update to a newer version of NuGet, which for some reason resolved the problem. However, the latest version of NuGet (4.3.0 ish) is now so new that it fails with a different error, saying "the assembly name is invalid" for ScriptCs.sln -- it doesn't seem able to parse the file anymore.

I'm able to get things to work by picking a medium-old NuGet.exe version--I inserted this line into my Dockerfile to use version 3.3.0:

RUN bash -c "cd Engine; wget https://dist.nuget.org/win-x86-commandline/v3.3.0/nuget.exe -O ./.nuget/NuGet.exe"

Anyway, long story short: something is weird and fragile about NuGet.exe/package dependencies in the current version of ICSharp.

insert on ubuntu18.04

之前说有机会就说下Linux下如何搭建C#版的交互编程,今天写篇文章还债^_^

Win下比较简单,可以自己看官方文档https://github.com/zabirauf/icsharp/wiki/Installation下面逆天带搭建搭建下Linux下的环境(官方方法有问题)

CSharp交互式编程

1.安装mono部分组件

先看看官方仓库,如果你不是Ubuntu的自己切换下源

安装mono部分组件,写段shell脚本,然后bash installmono.sh 直接执行

代码如下:

# add Ubuntu 18.04 repository
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# 更新一下
sudo apt-get update -y
# 安装 mono-complete
sudo apt-get install mono-complete -y
# 安装 mono-dbg
sudo apt-get install mono-dbg -y                 
# 安装 mono-runtime-dbg
sudo apt-get install mono-runtime-dbg -y
# 导入证书
mozroots --import --machine --sync
# 查看mono版本
mono --version

看到这个就代表安装完成了

2.安装Jupyter-notebook

这部之前说过了,你安装了conda之后什么都有了,可以参考之前我写的一篇文章:

Anaconda For Linux

3.环境配置

下载release包:
https://github.com/gyurisc/icsharp.kernel/releases/download/v1.0-beta/icsharp_kernel_v1.0.zip

然后移动到/opt/目录下(装软件一般都放这)
现在你可以运行icsharp了:mono icsharp.exe

4.编写代码

新建一个C#的ipynb文件

输入代码,shift+回车运行

其他的自己摸索摸索吧,先这样了~

Project does not build on Visual Studio 2015 Windows

Project does not build on Visual Studio 2015 windows x64. There were a number of reference errors.

To fix this issue, all the self-references were removed for the "Script" projects.

Then, the StyleCopMs Reference, was updated to version .50 from .49 in both engine and the main project.

Once this was done, I was able to build the project and run the rest of the steps successfully.

support mono backend of scriptcs (Roslyn is limited)

currently roslyn does not support dynamic objects in C#. in scriptcs the workaround is to start it up with scriptcs -modules mono command-line arguments to use Mono compiler backend. This second backend should be added to ICSHARP.

kernel is not compatible with latest jupyter (4.0) and scriptcs (0.14.1), python 2.7

When starting up ipython notebook not kernel is visible:

ipython notebook --config=icsharp
[I 16:30:27.421 NotebookApp] Serving notebooks from local directory: C:\Users\de
nis.akhiyarov
[I 16:30:27.423 NotebookApp] 0 active kernels
[I 16:30:27.424 NotebookApp] The IPython Notebook is running at: http://localhos
t:8888/
[I 16:30:27.424 NotebookApp] Use Control-C to stop this server and shut down all
 kernels (twice to skip confirmation).
[I 16:30:48.372 NotebookApp] Creating new notebook in
[I 16:30:49.515 NotebookApp] Kernel started: eb47f1af-e092-4d5e-91f2-413c8572810
f

chocolatey package update and errors

@zabirauf:

Here is the log file from chocolatey installer, please note that my Python is not installed using chocolatey, but official installer and this does not seem to be the problem:

2015-09-06 01:20:58,289 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.9.9.8, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2015-09-06 01:20:58,289 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.9.9.8, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2015-09-06 01:20:58,318 [DEBUG] - XmlConfiguration is now operational
2015-09-06 01:20:58,465 [INFO ] - ============================================================
2015-09-06 01:20:58,469 [INFO ] - Chocolatey v0.9.9.8
2015-09-06 01:20:58,477 [DEBUG] - Chocolatey is running on Windows v 10.0.10240.0
2015-09-06 01:20:58,483 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2015-09-06 01:20:58,487 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2015-09-06 01:20:58,501 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install ICSharp
2015-09-06 01:20:58,505 [DEBUG] - Received arguments: install ICSharp
2015-09-06 01:20:58,557 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple 
 check to be sure no sensitive data is shown, especially if copying 
 output to a gist for review.
2015-09-06 01:20:58,569 [DEBUG] - Configuration: CommandName='install'|CacheLocation='C:\Users\dta\AppData\Local\Temp'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|
Sources='https://chocolatey.org/api/v2/'|Debug='False'|Verbose='False'|
Force='False'|Noop='False'|HelpRequested='False'|RegularOutput='True'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='ICSharp'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='ICSharp'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.10240.0'|
Information.PlatformName='Windows'|
Information.ChocolateyVersion='0.9.9.8'|
Information.ChocolateyProductVersion='0.9.9.8'|
Information.FullName='choco, Version=0.9.9.8, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|Features.AutoUninstaller='False'|
Features.CheckSumFiles='True'|Features.FailOnAutoUninstaller='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'|
FeatureCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'|
PinCommand.Command='unknown'|
2015-09-06 01:20:58,577 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2015-09-06 01:20:58,584 [INFO ] - Installing the following packages:
2015-09-06 01:20:58,589 [INFO ] - ICSharp
2015-09-06 01:20:58,593 [INFO ] - By installing you accept licenses for the packages.
2015-09-06 01:21:10,379 [INFO ] - 
python v3.4.3.20150501
2015-09-06 01:21:10,415 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\python\tools\chocolateyInstall.ps1':
2015-09-06 01:21:10,425 [DEBUG] - # This file should be identical for all python* packages

$packageName = 'python'
$url = 'https://www.python.org/ftp/python/3.4.3/python-3.4.3.msi'
$url64 = 'https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64.msi'
$version = '3.4.3'
$fileType = 'msi'
$partialInstallArgs = '/qn /norestart ALLUSERS=1 TARGETDIR='



  $binRoot = Get-BinRoot
  $installPath = Join-Path $binRoot $packageName

  # The name of the installed Python version from Win32_Product
  $win32ProductName = $('^Python' + ' ' + [regex]::escape($version) + '$')

  # The Get-ProcessorBits is a misnomer. It returns the OS bitness, not the CPU bitness
  $osBitness = Get-ProcessorBits

  # If the OS is 64-bit and the package is not Python 32-bit specific,
  # it detects only an installed 64-bit version. This is incompatible with
  # the usage of the '-x86' parameter of Chocolatey, but I know no other
  # method to do this. Therefore I also created 32-bit specific Python packages
  # (python-x86_32 in this case).
  if (($osBitness -eq 64) -and ($packageName -notmatch 32)) {
    $win32ProductName = $('^Python' + ' ' + [regex]::escape($version) + ' ' + '\(64-bit\)$')
  }


  # Check if the same version and bitness of Python is already installed
  $sameVersionAlreadyInstalled = Get-WmiObject -Class Win32_Product |
    Where-Object {$_.Name -match $win32ProductName}

  # Construct the old installation path, which is mostly C:\PythonXX,
  # where XX stands for the major and minor version digits.
  $versionMajorMinor = $version -replace '^(\d+)\.(\d+).*', '$1$2'
  $oldInstallPath = Join-Path $env:SystemDrive "Python$versionMajorMinor"

  if (Test-Path $oldInstallPath) {
    $installPath = $oldInstallPath
    Write-Host @"
Warning: Old installation path “$oldInstallPath” detected.
This package will continue to install $packageName there unless you uninstall
$packageName from there and remove the “$oldInstallPath” folder. If you decide
to do that, reinstall this package with the -force parameter and it will
install to the Chocolatey bin root.

"@
  }

  $installArgs = $($partialInstallArgs + '"' + $installPath + '"')

  # Check if the same version of Python is already installed.
  # This prevents 1603 errors during the installation and an
  # unnecessary download of the Python installer.
  if ($sameVersionAlreadyInstalled) {
    Write-Host @"
$packageName v$version is already installed. Skipping unnecessary download
and installation. If you have installed $packageName in “$oldInstallPath”
and you want to use the Chocolatey bin root as installation path instead,
uninstall $packageName from the control panel, remove the “$oldInstallPath”
folder and reinstall this package with the -force parameter.

"@
  } else {
    # Otherwise install Python and and add the installation folder to the PATH.

    # If the package is only intended for the 32-bit version, only pass
    # the 32-bit version to the install package function.
    if ($packageName -match 32) {
      Install-ChocolateyPackage $packageName $fileType $installArgs $url
    } else {
      Install-ChocolateyPackage $packageName $fileType $installArgs $url $url64
    }


    Install-ChocolateyPath $installPath 'Machine'
    $env:Path = "$($env:Path);$installPath"
  }



2015-09-06 01:21:10,428 [INFO ] - The package python wants to run 'chocolateyInstall.ps1'.
2015-09-06 01:21:10,432 [INFO ] - Note: If you don't run this script, the installation will fail.
2015-09-06 01:21:10,436 [INFO ] - Note: To confirm automatically next time, use '-y' or consider setting 
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
2015-09-06 01:21:10,488 [INFO ] - Do you want to run the script?
2015-09-06 01:21:10,518 [INFO ] -  1) yes
2015-09-06 01:21:10,547 [INFO ] -  2) no
2015-09-06 01:21:10,577 [INFO ] -  3) print
2015-09-06 01:21:13,328 [DEBUG] - Calling command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\python\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"']
2015-09-06 01:21:16,359 [INFO ] -  Get-BinRoot is going to be deprecated by v1. Many packages no longer require it since the folders no longer have versions on them.
2015-09-06 01:21:31,146 [INFO ] -  python v3.4.3 is already installed. Skipping unnecessary download
2015-09-06 01:21:31,181 [INFO ] -  and installation. If you have installed python in "C:\Python34"
2015-09-06 01:21:31,204 [DEBUG] - Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\python\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"'] exited with '0'
2015-09-06 01:21:31,213 [INFO ] -  and you want to use the Chocolatey bin root as installation path instead,
2015-09-06 01:21:31,242 [DEBUG] - Calling command ['"shutdown" /a']
2015-09-06 01:21:31,270 [INFO ] -  uninstall python from the control panel, remove the "C:\Python34"
2015-09-06 01:21:31,329 [INFO ] -  folder and reinstall this package with the -force parameter.
2015-09-06 01:21:31,373 [DEBUG] - Command ['"shutdown" /a'] exited with '1116'
2015-09-06 01:21:31,428 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\python'
2015-09-06 01:21:31,459 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\python\python.nupkg'
  with checksum '0B774E0682E16FC66BBD6D936C694E1C'
2015-09-06 01:21:31,487 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\python\tools\chocolateyInstall.ps1'
  with checksum 'C8FB84E4F0CC59293705FF827F2C205B'
2015-09-06 01:21:31,522 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\python.3.4.3.20150501".
2015-09-06 01:21:31,565 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\python.3.4.3.20150501\.sxs".
2015-09-06 01:21:31,593 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\python.3.4.3.20150501\.pin".
2015-09-06 01:21:31,622 [INFO ] -  The install of python was successful.
2015-09-06 01:21:31,662 [INFO ] - 
easy.install v0.6.11.4
2015-09-06 01:21:31,705 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\easy.install\tools\chocolateyInstall.ps1':
2015-09-06 01:21:31,735 [DEBUG] - #import-module C:\Chocolatey\chocolateyInstall\helpers\chocolateyInstaller

$global:python_home = $null
$global:python_version = $null

function _cmd($command) {
  $result = cmd.exe /c "$command 2>&1" #stderr hack  
  return $result
}

function Get-RegistryValue($key, $value) {
  $item = (Get-ItemProperty $key $value -ErrorAction SilentlyContinue)
  if ($item -ne $null) { return $item.$value } else { return $null }
}  

function Get-Python-Home() {
  #envs: PYTHONHOME and PYTHON_HOME
  $result = $null

  $filename = Get-RegistryValue "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)' 

  if ($filename -eq $null) {
    $filename = Get-RegistryValue "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)'  
  }

  if ($filename -ne $null) {
    $file = Get-ChildItem $filename
    $result = $file.DirectoryName     
  }

  return $result
}

function Get-Python-Version() {
  $res = _cmd 'python -V' # Python 2.7.3

  if ($res -ne $null) {
    return $res.Replace('Python', '').Trim()
  }

  return $null  
}

function is64bit() {
  return ([IntPtr]::Size -eq 8)
}

function Python-Exec($url, $name) {
  # _cmd "cd /d %TEMP% && curl -O $url && python $name" #old way

  $filename = Join-Path $env:TEMP $name
  Get-ChocolateyWebFile 'easy.install' $filename $url

  if (has_file $filename) {
    Write-Host "Running python file: '$filename'"
    python $filename
  }  
}

function Install-setuptools($version) {
  Write-Host 'Installing setuptools from http://pypi.python.org/pypi/setuptools ...'
  $pyvrs = $global:python_version.substring(0, 3) #2.7.3 >> 2.7

  if (is64bit) {
    Python-Exec 'http://peak.telecommunity.com/dist/ez_setup.py' 'ez_setup.py'
  }
  else {  
    # http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
    $url = "http://pypi.python.org/packages/$pyvrs/s/setuptools/setuptools-$version.win32-py$pyvrs.exe"
    Install-ChocolateyPackage 'easy.install/setuptools' 'exe' '/S' $url 
  }
}

function Install-distribute() {   
  Write-Host 'Installing distribute, Distribute is a fork of the Setuptools project. works with python versions >= 3.0'
  Write-Host 'distribute homepage: http://pypi.python.org/pypi/distribute'
  Python-Exec 'http://python-distribute.org/distribute_setup.py' 'distribute_setup.py'
}

function Install-easy-install() {
   $pyvrs = [int]$global:python_version.Replace('.', '').substring(0, 2) # 27

    if ($pyvrs -gt 27) {
      Install-distribute
    }
    else {
      Install-setuptools '0.6c11'  
    }     
}  

function has_file($filename) {
  return Test-Path $filename
} 

function Verify-installation() {
  return has_file (Join-Path $global:python_home 'Scripts\easy_install.exe')
}

function setup-python() {
  $python_home = Get-Python-Home

  if ($python_home -eq $null) {    
    Write-Host "Installing Python using chocolatey. Wait..."
    cinst python    

    $python_home = Get-Python-Home

    if ($python_home -eq $null) {
      throw 'Python is not installed. easy_install installation aborted!'
    }
  }    

  $python_script = Join-Path $python_home 'Scripts'
  Install-ChocolateyPath $python_home 'User'
  Install-ChocolateyPath $python_script 'User'

  Write-Host "Setting PYTHONHOME environment variable to '$python_home'"
  Write-Host "PS: PYTHONHOME variable is not required to Python works, but it is a good practice to have it."
  [Environment]::SetEnvironmentVariable('PYTHONHOME', $python_home, 'User')  
  $Env:PYTHONHOME = $python_home

  return $python_home
}

function chocolatey-initialize() {
  $global:python_home = setup-python

  Write-Host "Using python home at '$global:python_home'"

  $global:python_version = Get-Python-Version

  if ($global:python_version -eq $null) {
    throw "Python Version could not be found. Executing 'python -V' at prompt works?"
  }
}  

function chocolatey-install() {
    try {
        chocolatey-initialize
        Write-Host "Installing easy_install for Python($global:python_version)..."

        Install-easy-install

        $status = Verify-installation

        if ($status) {
          Write-ChocolateySuccess 'easy.install'
        }  

    } catch {
      Write-ChocolateyFailure 'easy.install' "$($_.Exception.Message)"
      throw 
    }
}

chocolatey-install # installs easy_install



2015-09-06 01:21:31,758 [INFO ] - The package easy.install wants to run 'chocolateyInstall.ps1'.
2015-09-06 01:21:31,784 [INFO ] - Note: If you don't run this script, the installation will fail.
2015-09-06 01:21:31,812 [INFO ] - Note: To confirm automatically next time, use '-y' or consider setting 
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
2015-09-06 01:21:31,841 [INFO ] - Do you want to run the script?
2015-09-06 01:21:31,867 [INFO ] -  1) yes
2015-09-06 01:21:31,893 [INFO ] -  2) no
2015-09-06 01:21:31,921 [INFO ] -  3) print
2015-09-06 01:21:56,962 [DEBUG] - Calling command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\easy.install\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"']
2015-09-06 01:21:58,084 [INFO ] -  Setting PYTHONHOME environment variable to 'F:\Python\Python27'
2015-09-06 01:21:58,118 [INFO ] -  PS: PYTHONHOME variable is not required to Python works, but it is a good practice to have it.
2015-09-06 01:22:00,284 [INFO ] -  Using python home at 'F:\Python\Python27'
2015-09-06 01:22:00,435 [INFO ] -  Installing easy_install for Python(2.7.10)...
2015-09-06 01:22:00,462 [INFO ] -  Installing setuptools from http://pypi.python.org/pypi/setuptools ...
2015-09-06 01:22:01,377 [INFO ] -  Downloading easy.install 32 bit
2015-09-06 01:22:01,410 [INFO ] -    from 'http://peak.telecommunity.com/dist/ez_setup.py'
2015-09-06 01:22:03,740 [INFO ] -  Running python file: 'C:\Users\dta\AppData\Local\Temp\ez_setup.py'
2015-09-06 01:22:05,034 [INFO ] -  Setuptools version 0.6c11 or greater has been installed.
2015-09-06 01:22:05,068 [DEBUG] - Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\easy.install\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"'] exited with '0'
2015-09-06 01:22:05,068 [INFO ] -  (Run "ez_setup.py -U setuptools" to reinstall or upgrade.)
2015-09-06 01:22:05,098 [DEBUG] - Calling command ['"shutdown" /a']
2015-09-06 01:22:05,128 [WARN ] -  WARNING: Write-ChocolateySuccess is deprecated. If you are the maintainer, please remove it from your package file.
2015-09-06 01:22:05,231 [DEBUG] - Command ['"shutdown" /a'] exited with '1116'
2015-09-06 01:22:05,279 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\easy.install'
2015-09-06 01:22:05,309 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\easy.install\easy.install.nupkg'
  with checksum 'C3440040531768A3FD9CC9474AF1AED0'
2015-09-06 01:22:05,337 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\easy.install\python-logo.png'
  with checksum '6CDF1232B1F705573716E1C3733A7BBC'
2015-09-06 01:22:05,367 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\easy.install\Thumbs.db'
  with checksum 'DCB7D6EA0B91394B6493C890A4C5F5AD'
2015-09-06 01:22:05,396 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\easy.install\tools\chocolateyInstall.ps1'
  with checksum '3E956701E9AE6D496C572AC5D0FDAA50'
2015-09-06 01:22:05,426 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\easy.install.0.6.11.4".
2015-09-06 01:22:05,460 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\easy.install.0.6.11.4\.sxs".
2015-09-06 01:22:05,490 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\easy.install.0.6.11.4\.pin".
2015-09-06 01:22:05,519 [INFO ] -  The install of easy.install was successful.
2015-09-06 01:22:05,564 [INFO ] - 
pip v1.2.0
2015-09-06 01:22:05,610 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\pip\tools\chocolateyInstall.ps1':
2015-09-06 01:22:05,639 [DEBUG] - #import-module C:\Chocolatey\chocolateyInstall\helpers\chocolateyInstaller

function Get-RegistryValue($key, $value) {
  $item = (Get-ItemProperty $key $value -ErrorAction SilentlyContinue)
  if ($item -ne $null) { return $item.$value } else { return $null }
}  

function Get-Python-Home() {
  $result = $null

  $filename = Get-RegistryValue "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)' 

  if ($filename -eq $null) {
    $filename = Get-RegistryValue "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" '(default)'  
  }

  if ($filename -ne $null) {
    $file = Get-ChildItem $filename
    $result = $file.DirectoryName     
  }

  return $result
}


$global:python_home = Get-Python-Home

function CreateFolder ([string]$Path) {
  New-Item -Path $Path -type directory -Force
}

function chocolatey-install() {
    try {
      easy_install pip
      Write-ChocolateySuccess 'pip'
    } catch {
      Write-ChocolateyFailure 'pip' "$($_.Exception.Message)"
      throw 
    }
}

chocolatey-install   

2015-09-06 01:22:05,664 [INFO ] - The package pip wants to run 'chocolateyInstall.ps1'.
2015-09-06 01:22:05,690 [INFO ] - Note: If you don't run this script, the installation will fail.
2015-09-06 01:22:05,716 [INFO ] - Note: To confirm automatically next time, use '-y' or consider setting 
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
2015-09-06 01:22:05,745 [INFO ] - Do you want to run the script?
2015-09-06 01:22:05,775 [INFO ] -  1) yes
2015-09-06 01:22:05,801 [INFO ] -  2) no
2015-09-06 01:22:05,829 [INFO ] -  3) print
2015-09-06 01:22:08,658 [DEBUG] - Calling command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\pip\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"']
2015-09-06 01:22:10,690 [INFO ] -  Searching for pip
2015-09-06 01:22:10,723 [INFO ] -  Best match: pip 7.0.1
2015-09-06 01:22:10,753 [INFO ] -  Adding pip 7.0.1 to easy-install.pth file
2015-09-06 01:22:10,781 [INFO ] -  Installing pip-script.py script to F:\Python\Python27\Scripts
2015-09-06 01:22:10,808 [INFO ] -  Installing pip.exe script to F:\Python\Python27\Scripts
2015-09-06 01:22:10,845 [INFO ] -  Installing pip.exe.manifest script to F:\Python\Python27\Scripts
2015-09-06 01:22:10,857 [DEBUG] - Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\pip\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''"'] exited with '0'
2015-09-06 01:22:10,878 [INFO ] -  Installing pip3.4-script.py script to F:\Python\Python27\Scripts
2015-09-06 01:22:10,903 [DEBUG] - Calling command ['"shutdown" /a']
2015-09-06 01:22:10,927 [INFO ] -  Installing pip3.4.exe script to F:\Python\Python27\Scripts
2015-09-06 01:22:10,978 [INFO ] -  Installing pip3.4.exe.manifest script to F:\Python\Python27\Scripts
2015-09-06 01:22:11,006 [INFO ] -  Installing pip3-script.py script to F:\Python\Python27\Scripts
2015-09-06 01:22:11,020 [DEBUG] - Command ['"shutdown" /a'] exited with '1116'
2015-09-06 01:22:11,042 [INFO ] -  Installing pip3.exe script to F:\Python\Python27\Scripts
2015-09-06 01:22:11,088 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\pip'
2015-09-06 01:22:11,093 [INFO ] -  Installing pip3.exe.manifest script to F:\Python\Python27\Scripts
2015-09-06 01:22:11,118 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\pip\pip.nupkg'
  with checksum '3FCA36C90FD738A949E6D34929C49F2D'
2015-09-06 01:22:11,143 [INFO ] -  Using f:\python\python27\lib\site-packages
2015-09-06 01:22:11,168 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\pip\tools\chocolateyInstall.ps1'
  with checksum '73D3FBCDF7C8E94D428BA0FB938F6D53'
2015-09-06 01:22:11,194 [INFO ] -  Processing dependencies for pip
2015-09-06 01:22:11,218 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\pip.1.2.0".
2015-09-06 01:22:11,243 [INFO ] -  Finished processing dependencies for pip
2015-09-06 01:22:11,271 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\pip.1.2.0\.sxs".
2015-09-06 01:22:11,291 [WARN ] -  WARNING: Write-ChocolateySuccess is deprecated. If you are the maintainer, please remove it from your package file.
2015-09-06 01:22:11,322 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\pip.1.2.0\.pin".
2015-09-06 01:22:11,382 [INFO ] -  The install of pip was successful.
2015-09-06 01:22:11,871 [INFO ] - 
ICSharp v0.1
2015-09-06 01:22:11,927 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\ICSharp\tools\chocolateyinstall.ps1':
2015-09-06 01:22:11,959 [DEBUG] - $packageName = 'icsharp'
$validExitCodes = @(0)

try {
  $tools = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
  #$nuget = "$env:ChocolateyInstall\ChocolateyInstall\nuget"
  $binPath = "$env:APPDATA\icsharp"
  #$nugetPath = "$tools\nugets"
  $profilePath = "$env:USERPROFILE"
  $ipythonUserProfile = "$profilePath\.ipython"
  $profileCsharp = "profile_icsharp"
  $profileCsharpPath = "$ipythonUserProfile\$profileCsharp"
  $icsharpKernel = "$binpath\iCSharp.Kernel.exe"

  New-Item $binPath -ItemType Directory -Force | Out-Null

  Copy-Item "$tools\icsharp\*" $binPath -Force

  &pip install ipython
  Write-Host "ipython installed"

  &ipython profile create icsharp
  Write-Host "ICSharp profile created"

  if(-not(Test-Path($profileCsharpPath)))
  {
    throw "IPython profile not created"
  }

  $profileOut = @()
  $profileOut += "c = get_config()"
  $profileOut += "c.KernelManager.kernel_cmd = [r""$icsharpKernel"", ""{connection_file}""]"
  $profileOut += "c.Session.key = ''"
  $profileOut += "c.Session.keyfile = ''"

  $profileOut | Out-File -FilePath "$profileCsharpPath\ipython_config.py" -Encoding utf8

  $profileOut | Out-File -FilePath "$profileCsharpPath\ipython_notebook_config.py" -Encoding utf8

  Write-Host "Change 2"
  Write-Host "icsharp has been installed to $binpath and has been added." -ForegroundColor DarkYellow
  Write-Host "You may need to open a new console for the new path to take effect. Happy scripting!" -ForegroundColor DarkYellow
  Write-ChocolateySuccess "$packageName"
} catch {
  Write-ChocolateyFailure "$packageName" "$($_.Exception.Message)"
  throw
}
2015-09-06 01:22:11,963 [INFO ] - The package ICSharp wants to run 'chocolateyinstall.ps1'.
2015-09-06 01:22:11,970 [INFO ] - Note: If you don't run this script, the installation will fail.
2015-09-06 01:22:11,978 [INFO ] - Note: To confirm automatically next time, use '-y' or consider setting 
 'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
2015-09-06 01:22:12,018 [INFO ] - Do you want to run the script?
2015-09-06 01:22:12,054 [INFO ] -  1) yes
2015-09-06 01:22:12,093 [INFO ] -  2) no
2015-09-06 01:22:12,134 [INFO ] -  3) print
2015-09-06 01:22:25,457 [DEBUG] - Calling command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\ICSharp\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters ''"']
2015-09-06 01:22:28,775 [ERROR] -  You are using pip version 7.0.1, however version 7.1.2 is available.
2015-09-06 01:22:28,791 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): ipython in f:\python\python27\lib\site-packages
2015-09-06 01:22:28,845 [ERROR] -  You should consider upgrading via the 'pip install --upgrade pip' command.
2015-09-06 01:22:28,878 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): decorator in f:\python\python27\lib\site-packages (from ipython)
2015-09-06 01:22:28,941 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in f:\python\python27\lib\site-packages (from ipython)
2015-09-06 01:22:28,978 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): traitlets in f:\python\python27\lib\site-packages (from ipython)
2015-09-06 01:22:29,013 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): pickleshare in f:\python\python27\lib\site-packages (from ipython)
2015-09-06 01:22:29,048 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in f:\python\python27\lib\site-packages (from traitlets->ipython)
2015-09-06 01:22:29,082 [INFO ] -  Requirement already satisfied (use --upgrade to upgrade): path.py in f:\python\python27\lib\site-packages (from pickleshare->ipython)
2015-09-06 01:22:29,118 [INFO ] -  ipython installed
2015-09-06 01:22:31,609 [ERROR] -  [ProfileCreate] Generating default config file: u'C:\\Users\\dta\\.ipython\\profile_icsharp\\ipython_config.py'
2015-09-06 01:22:31,653 [ERROR] -  [ProfileCreate] Generating default config file: u'C:\\Users\\dta\\.ipython\\profile_icsharp\\ipython_kernel_config.py'
2015-09-06 01:22:31,661 [INFO ] -  ICSharp profile created
2015-09-06 01:22:31,732 [INFO ] -  Change 2
2015-09-06 01:22:31,764 [DEBUG] - Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\ICSharp\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters ''"'] exited with '0'
2015-09-06 01:22:31,766 [INFO ] -  icsharp has been installed to C:\Users\dta\AppData\Roaming\icsharp and has been added.
2015-09-06 01:22:31,799 [DEBUG] - Calling command ['"shutdown" /a']
2015-09-06 01:22:31,830 [INFO ] -  You may need to open a new console for the new path to take effect. Happy scripting!
2015-09-06 01:22:31,893 [WARN ] -  WARNING: Write-ChocolateySuccess is deprecated. If you are the maintainer, please remove it from your package file.
2015-09-06 01:22:31,932 [DEBUG] - Command ['"shutdown" /a'] exited with '1116'
2015-09-06 01:22:31,977 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\ICSharp'
2015-09-06 01:22:32,020 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\ICSharp.nupkg'
  with checksum '8DBD42E0D9A96D104E23CFC047645591'
2015-09-06 01:22:32,050 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\chocolateyinstall.ps1'
  with checksum '7102E7DF92A2C3CB4945115815004AA2'
2015-09-06 01:22:32,056 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Autofac.dll'
  with checksum 'D925050321936F415C557BFACC5D9F32'
2015-09-06 01:22:32,060 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Autofac.Integration.Mef.dll'
  with checksum '8BFA67721A2A2333C58082D7257FF1F6'
2015-09-06 01:22:32,064 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Autofac.Integration.Mef.xml'
  with checksum '12BE6F36E0BA907DD2BA9409CF02AFAC'
2015-09-06 01:22:32,068 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Autofac.xml'
  with checksum '45FF2D624855B17F617CAA960B142BF6'
2015-09-06 01:22:32,071 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Common.dll'
  with checksum '4D5C08D991DCACDEE3386DDB89892CF5'
2015-09-06 01:22:32,075 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Common.Logging.dll'
  with checksum 'A374D30EAA4F0A4B7C09DA2768939C71'
2015-09-06 01:22:32,078 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Common.Logging.pdb'
  with checksum '0233AB7716C8563541246177BF670661'
2015-09-06 01:22:32,081 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Common.Logging.xml'
  with checksum '7AB8E8699F9EAB42B8AE7E86D2EF6335'
2015-09-06 01:22:32,083 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Common.pdb'
  with checksum '20803E22DF000E5ACABDF43A6B8028D1'
2015-09-06 01:22:32,086 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.exe'
  with checksum '72DEC3DA5415DFBE80A1FFA8F426146B'
2015-09-06 01:22:32,089 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.exe.config'
  with checksum '3F9B7C50015CA8BE5EC84127BB37E2CB'
2015-09-06 01:22:32,093 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.pdb'
  with checksum '1D43373F7765543D7BB82534C4239363'
2015-09-06 01:22:32,096 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.vshost.exe'
  with checksum '00C54466CFC232E2BA1DFC4F3A679F05'
2015-09-06 01:22:32,099 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.vshost.exe.config'
  with checksum '3F9B7C50015CA8BE5EC84127BB37E2CB'
2015-09-06 01:22:32,102 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Kernel.vshost.exe.manifest'
  with checksum 'A19A2658BA69030C6AC9D11FD7D7E3C1'
2015-09-06 01:22:32,105 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Messages.dll'
  with checksum '3FFC9D68E9924719AA460E914ACDF6B1'
2015-09-06 01:22:32,108 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\iCSharp.Messages.pdb'
  with checksum 'E9C1540BA4B4EE1175F5788E9F08380E'
2015-09-06 01:22:32,143 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ICSharpCode.NRefactory.CSharp.dll'
  with checksum '2E3EB0025415144E2EED9924873F938D'
2015-09-06 01:22:32,151 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ICSharpCode.NRefactory.CSharp.xml'
  with checksum '864B763FF4F152C26B66CAA2D2ECC902'
2015-09-06 01:22:32,155 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ICSharpCode.NRefactory.dll'
  with checksum 'AE294145977BF86089B65D7EC4E49906'
2015-09-06 01:22:32,160 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ICSharpCode.NRefactory.xml'
  with checksum '000A228D7F0E9A12E9D2F74B9860BEE8'
2015-09-06 01:22:32,163 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Microsoft.Web.XmlTransform.dll'
  with checksum 'A21A47E1C885E2A6BF493D5D76919F1E'
2015-09-06 01:22:32,166 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Mono.Cecil.dll'
  with checksum 'B1C7DA53F32E6425B84C118047FDFAB4'
2015-09-06 01:22:32,190 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Mono.CSharp.dll'
  with checksum '625150A6D2D073D95E2D2A29AED44895'
2015-09-06 01:22:32,194 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\NetMQ.dll'
  with checksum 'DDDAE253DA14B8280318F32173F136CE'
2015-09-06 01:22:32,199 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Newtonsoft.Json.dll'
  with checksum 'CBD6029ABAA8E977D3B7435C6F70DD0E'
2015-09-06 01:22:32,205 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Newtonsoft.Json.xml'
  with checksum '93BF6EA3562E374AF6C2F1DF1C91DC86'
2015-09-06 01:22:32,209 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\NuGet.Core.dll'
  with checksum '419500823F6972B80895B8A09875B8C6'
2015-09-06 01:22:32,212 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\PowerArgs.dll'
  with checksum 'DF70C772FDB43E16D7EB192F2197E60E'
2015-09-06 01:22:32,216 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\PowerArgs.xml'
  with checksum 'C2A4DC848484FE879C9D13C11363D43D'
2015-09-06 01:22:32,260 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Roslyn.Compilers.CSharp.dll'
  with checksum '2844DA7FD88A6E20901A34DE4D2183CB'
2015-09-06 01:22:32,291 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Roslyn.Compilers.CSharp.xml'
  with checksum '5F7B379A71D60CBFFA9A9C753F81427D'
2015-09-06 01:22:32,319 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Roslyn.Compilers.dll'
  with checksum 'DB00CBD84B662FD96B074BE78D631CFA'
2015-09-06 01:22:32,325 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\Roslyn.Compilers.xml'
  with checksum '2FD43302749B3907976D94EBCC3902A6'
2015-09-06 01:22:32,328 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Contracts.dll'
  with checksum 'ED07AEF585471AE7049A2233672D5861'
2015-09-06 01:22:32,331 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Contracts.pdb'
  with checksum '8CB318670A8103E1906965472D87458B'
2015-09-06 01:22:32,333 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Core.dll'
  with checksum 'D49A13DF831C5801BAC0564A4A9D5EB1'
2015-09-06 01:22:32,337 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Core.pdb'
  with checksum '83DC044110A3D119A404F2BCB538A8E3'
2015-09-06 01:22:32,340 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Engine.Mono.dll'
  with checksum '3711CE994E58D329A6F81382A6632C9D'
2015-09-06 01:22:32,343 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Engine.Mono.pdb'
  with checksum 'C7B218CB78F6F880C03CDD10CB51198B'
2015-09-06 01:22:32,346 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Engine.Roslyn.dll'
  with checksum '3D087F2FCDD8059EB345BFA3DE5628A0'
2015-09-06 01:22:32,349 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Engine.Roslyn.pdb'
  with checksum 'E6BE8F1B0E2B07A238F094BE0EFACD3B'
2015-09-06 01:22:32,353 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\scriptcs.exe'
  with checksum 'F54FDC463DAE7F3F4711280728E954E8'
2015-09-06 01:22:32,356 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Hosting.dll'
  with checksum '31AB8C325F2570D15A0ECAFCF7C7E836'
2015-09-06 01:22:32,359 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\ScriptCs.Hosting.pdb'
  with checksum '9EE0486A2FB3C24A90FB05DD09D01C25'
2015-09-06 01:22:32,362 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\ICSharp\tools\icsharp\scriptcs.pdb'
  with checksum '58A4A2E556865DF38407EF5B16744080'
2015-09-06 01:22:32,366 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\ICSharp.0.1".
2015-09-06 01:22:32,374 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\ICSharp.0.1\.sxs".
2015-09-06 01:22:32,377 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\ICSharp.0.1\.pin".
2015-09-06 01:22:32,380 [ERROR] - The install of icsharp was NOT successful.
2015-09-06 01:22:32,388 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\ICSharp\tools\chocolateyinstall.ps1'.
 See log for details.
2015-09-06 01:22:32,395 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\ICSharp'
 to 'C:\ProgramData\chocolatey\lib-bad\ICSharp'
2015-09-06 01:22:34,405 [WARN ] - 
Chocolatey installed 3/4 package(s). 1 package(s) failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2015-09-06 01:22:34,411 [ERROR] - Failures:
2015-09-06 01:22:34,416 [ERROR] -  - icsharp
2015-09-06 01:22:34,421 [DEBUG] - Exiting with 1

Kernel not found: None

I don't quite understand why the kernel can't be found.

jupyter notebook --KernelManager.kernel_cmd="['mono', '/usr/local/JupyterKernels/icsharp/Kernel/bin/Release/iCSharp.Kernel.exe', '{connection_file}']" --MappingKernelManager.default_kernel_name='icsharp'

501 POST /api/sessions

iCSharp.Kernel.exe‘s directory is installed in /usr/local/JupyterKernels/icsharp/Kernel/bin/Release/,what does kernel_cmd the third element connection_file mean?

Add instructions regarding compiling using mono in Wiki

Running ICSharp under Linux has huge benefits! For me:
Easy command line deployment and monitoring.
Docker Images, so if we had a Docker Image for ICSharp, then we would be up and
rolling on Jupyter with ICSharp kernel in 10 keystrokes and 10 minutes.

The good news is: it all works under Linux!! It is just not yet very easy to do it.

My notes are under:
https://docs.google.com/document/d/1UMN7WFRQ43KrF1yWcjsMDNqD6NcRe2x5fL99v2aRdPk/edit?usp=sharing

I setup a dedicated new debian 7.8 server. If anyone wants to experiment there the next couple
of weesk, then I will send around the security key one needs to login.

WHAT TO ADD TO ICSHARP Project>
I would add a couple of shell scripts that allow building ICSharp on mono.
I put them into the above document (Basically my how to do it document to help me going)

1, installmono.sh
Since Mono in itself is not so easy to install as under Windows, and one can very easily end
up with a non working or old system, I would add installmono.sh

  1. compileScriptCS.sh
    Even if I would never need it, I would always compile ScriptCS as a standalone project first.
    because if this does not work, then it will be way more difficutl to detect it in ICSharp
  2. build.sh
    It works. But only with a trick. The build.sh of ScriptCS in the Engine directory needs to
    be compiled first. This is because of a StyleCop reference issue in ScriptCS.Contracts.
    I guess that we need to contact ScriptCS maintainers to fix this longterm. But With my trick
    it works.
  3. intallkernel.sh
    Working on this right now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.