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

Fails with conda #49

Closed
josephwinston opened this issue Apr 24, 2015 · 8 comments
Closed

Fails with conda #49

josephwinston opened this issue Apr 24, 2015 · 8 comments

Comments

@josephwinston
Copy link

Rodeo installs fine:

N:\>pip install rodeo
Collecting rodeo
  Downloading rodeo-0.2.1.tar.gz (3.5MB)
    100% |################################| 3.5MB 116kB/s
Requirement already satisfied (use --upgrade to upgrade): ipython>=3.0.0 in c:\anaconda\lib\site-packages (from rodeo)
Requirement already satisfied (use --upgrade to upgrade): Flask>=0.10.1 in c:\anaconda\lib\site-packages (from rodeo)
Requirement already satisfied (use --upgrade to upgrade): jedi in c:\anaconda\lib\site-packages (from rodeo)
Collecting docopt (from rodeo)
  Downloading docopt-0.6.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pyzmq>=13 in c:\anaconda\lib\site-packages (from rodeo)
Installing collected packages: docopt, rodeo
  Running setup.py install for docopt
  Running setup.py install for rodeo
    Installing rodeo-script.py script to C:\Anaconda\Scripts
    Installing rodeo.exe script to C:\Anaconda\Scripts
Successfully installed docopt-0.6.2 rodeo-0.2.1

Command line without options prints help:

N:\>rodeo
rodeo

Usage:
  rodeo [--port=<int>] [<directory>]
  rodeo (-h | --help)
  rodeo --version

Options:
  -h --help     Show this screen.
  --version     Show version.

Help:
Rodeo is a data centric IDE for python. It leverages the IPython
Kernel but presents a different user experience than the notebook.
Those of you who use products like SublimeText or Eclipse will
probably find rodeo familiar.

Examples:
To run a rodeo server, just execute the `rodeo` command like so:
    $ rodeo . # basic usage
    $ rodeo . --port=4567 # run in this directory, but on port 4567
    $ rodeo /path/to/a/folder # run in a different directory
    $ rodeo /path/to/a/folder --port=4567 # new directory, new port

Running fails:

N:\>rodeo .
Traceback (most recent call last):
  File "C:\Anaconda\Scripts\rodeo-script.py", line 9, in <module>
    load_entry_point('rodeo==0.2.1', 'console_scripts', 'rodeo')()
  File "C:\Anaconda\lib\site-packages\rodeo\cli.py", line 41, in cmd
    main(active_dir)
  File "C:\Anaconda\lib\site-packages\rodeo\rodeo.py", line 72, in main
    kernel = Kernel()
  File "C:\Anaconda\lib\site-packages\rodeo\kernel.py", line 91, in __init__
    self.client.load_connection_file()
  File "C:\Anaconda\lib\site-packages\IPython\kernel\connect.py", line 503, in load_connection_file
    with open(self.connection_file) as f:
IOError: [Errno 2] No such file or directory: u'c:\\users\\hb55683\\appdata\\local\\temp\\kernel-5bb3c7e2-6874-4876-a547-b9c80dcad79
4.json'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Anaconda\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "C:\Anaconda\lib\site-packages\rodeo\kernel.py", line 83, in remove_config
    os.remove(config)
WindowsError: [Error 2] The system cannot find the file specified: 'c:\\users\\hb55683\\appdata\\local\\temp\\kernel-5bb3c7e2-6874-4
876-a547-b9c80dcad794.json'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Anaconda\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "C:\Anaconda\lib\site-packages\rodeo\kernel.py", line 83, in remove_config
    os.remove(config)
WindowsError: [Error 2] The system cannot find the file specified: 'c:\\users\\hb55683\\appdata\\local\\temp\\kernel-5bb3c7e2-6874-4
876-a547-b9c80dcad794.json'
@jankatins
Copy link

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

@glamp
Copy link
Contributor

glamp commented Apr 24, 2015

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?

@jankatins
Copy link

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

@glamp
Copy link
Contributor

glamp commented Apr 24, 2015

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

@jankatins
Copy link

@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").

@jankatins
Copy link

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.

@Biluoshilang
Copy link

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

@glamp
Copy link
Contributor

glamp commented Jun 17, 2015

I believe this works now

@glamp glamp closed this as completed Jun 17, 2015
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

4 participants