GithubHelp home page GithubHelp logo

Fails with conda about rodeo HOT 8 CLOSED

yhat avatar yhat commented on June 24, 2024
Fails with conda

from rodeo.

Comments (8)

jankatins avatar jankatins commented on June 24, 2024

If you want to remove your own kernel startup and use one which IPython also uses in some places under the hood:

from IPython.kernel.multikernelmanager import MultiKernelManager
kernel_name = "python"
self.log.info("Starting a new kernel: %s" % kernel_name)
_km = MultiKernelManager(log=self.log, parent=self)
#_km.list_kernel_ids()
kernelid = _km.start_kernel(kernel_name=kernel_name)
kn = _km.get_kernel(kernelid)
kc = kn.client()
# now initalize the channels
kc.start_channels()
kc.wait_for_ready()

from rodeo.

glamp avatar glamp commented on June 24, 2024

what is self.log in that code block?

I tested this out but it got the following error:

Traceback (most recent call last):
  File "rodeo/rodeo.py", line 115, in <module>
    main(directory)
  File "rodeo/rodeo.py", line 96, in main
    kernel = Kernel()
  File "/Users/glamp/repos/yhat/prototypes/rodeo/rodeo/kernel.py", line 81, in __init__
    self._kernel_manager = MultiKernelManager(parent=self)
  File "/usr/local/lib/python2.7/site-packages/IPython/config/configurable.py", line 68, in __init__
    kwargs['config'] = parent.config
AttributeError: 'Kernel' object has no attribute 'config'

Seems like I would still need the config file?

from rodeo.

jankatins avatar jankatins commented on June 24, 2024

self is in this case a LoggingConfigurable, which has a logger object at self.log and a config object as self.config (the parent is needed to get config information from the parent to other classes and also access the main log). LoggingConfigurable is quite nice, it gets you the traitlets, logs and the inheritable config and if you use IPython.config.application.Application as the main class for your app you get comamand line handling and such things...

You can probably use it like _km = MultiKernelManager().

See here for the original code: https://github.com/JanSchulz/knitpy/blob/master/knitpy/knitpy.py#L639

from rodeo.

glamp avatar glamp commented on June 24, 2024

is there a way to run it without generating a config file?

from rodeo.

jankatins avatar jankatins commented on June 24, 2024

@glamp: _km = MultiKernelManager() (without any parent/argument)?

Yes, a LoggingConfigurable can be used without passing in a parent/config/log, e.g. you can use Knitpy().render(...) directly without having a config object. The config object anyway does not depend on a file, you can build one yourself, if you want (the ipython config files are such a "builder").

from rodeo.

jankatins avatar jankatins commented on June 24, 2024

You can also use IPython.kernel.manager.start_new_kernel(....). That might be more appropriate as the UI only handles one kernel at a time.

from rodeo.

Biluoshilang avatar Biluoshilang commented on June 24, 2024

I got the error "failed to create process"(in win7) and:
Traceback (most recent call last):
File "rodeo.py", line 1, in
from .kernel import Kernel
SystemError: Parent module '' not loaded, cannot perform relative import

from rodeo.

glamp avatar glamp commented on June 24, 2024

I believe this works now

from rodeo.

Related Issues (20)

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.