KelvinJin / iSwift

A Swift kernel for IPython.
150 stars 16 forks source link

Getting a Kernel Error when starting a Swift notebook #1

Open giff-h opened 7 years ago

giff-h commented 7 years ago

Traceback (most recent call last): File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/notebook/base/handlers.py", line 503, in wrapper result = yield gen.maybe_future(method(self, *args, **kwargs)) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 75, in post type=mtype)) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/Users/hamstap85/.virtualenvs/moin/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 "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/Users/hamstap85/.virtualenvs/moin/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 "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/tornado/gen.py", line 285, in wrapper yielded = next(result) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel super(MappingKernelManager, self).start_kernel(**kwargs) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel km.start_kernel(**kwargs) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/jupyter_client/manager.py", line 243, in start_kernel **kw) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/jupyter_client/manager.py", line 189, in _launch_kernel return launch_kernel(kernel_cmd, **kw) File "/Users/hamstap85/.virtualenvs/moin/lib/python3.6/site-packages/jupyter_client/launcher.py", line 123, in launch_kernel proc = Popen(cmd, **kwargs) File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__ restore_signals, start_new_session) File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: '.build/debug/iSwift'

giff-h commented 7 years ago

Sorry, didn't mean to submit immediately.

I'm on OSX. That's the error it spits out. It also gives these warnings on swift build: /Users/hamstap85/Coding/builds/iSwift/Sources/BlockingQueue.swift:40:23: warning: result of call to 'wait(timeout:)' is unused dataSemaphore.wait(timeout: t) ^ ~~~~~~~~~~~~ /Users/hamstap85/Coding/builds/iSwift/Sources/REPLWrapper.swift:181:25: warning: result of call to 'wait(timeout:)' is unused promptSemaphore.wait(timeout: DispatchTime.distantFuture) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/hamstap85/Coding/builds/iSwift/Sources/Shell.swift:52:9: warning: result of call to 'fcntl' is unused fcntl(fdMaster, F_SETFD, FD_CLOEXEC) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/hamstap85/Coding/builds/iSwift/Sources/Shell.swift:53:9: warning: result of call to 'fcntl' is unused fcntl(fdSlave, F_SETFD, FD_CLOEXEC) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

KelvinJin commented 7 years ago

Gday, @hamstap85! The error indicates that the path of the generated swift executable is wrongly configured. You need to make sure the path inside your kernel.json is correctly pointed to the iSwift executable generated by running swift build. Normally, it would be under the hidden path called .build/debug/iSwift in your project folder.

The warnings from swift build are all safe. No need to worry about them.

Let me know how it goes. I know installing would be a bit painful without docker.

lancekindle commented 6 years ago

I was completely lost too. It would be great if there was an install script that would setup these variables.... I found a promising install script at https://github.com/dsblank/simple_kernel/blob/master/install_script.sh

But for a quick fix, edit the iSwiftKernel/kernel.json and change /root/iSwift/.build/debug/iSwift to represent the location where you've installed the iSwift-master folder, such as (if I put this folder in my /home/lance/bin folder): /home/lance/bin/iSwift-master/.build/debug/iSwift