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

make redis_kernel work with a jupyter virtual environment #4

Open
marmalodak opened this issue Jun 9, 2015 · 2 comments
Open

make redis_kernel work with a jupyter virtual environment #4

marmalodak opened this issue Jun 9, 2015 · 2 comments

Comments

@marmalodak
Copy link

It seems to work with a Python 3.4 virtual environment. Can it work in a virtual environment where I install Jupyter instead of IPython?

@hari-allamraju
Copy link
Member

I tried this setup over the weekend and I can see it mostly works with the redis kernel installed in ~/.ipython or $IPYTHONDIR somewhere else, and I only get deprecation warnings that I should change my base class soon.

I think I will create another package for Jupyter, but that will be a few weeks.

This is my setup - can you tell me if you did anything different and I will check with that to identify why it fails for you -

  • Cloned jupyter_console from Jupyter Github
  • Installed all the components from requirements.tx
  • Installed jupyter_console using the setup.py
  • Ran 'jupyter kernelspec list' to confirm that it can see my redis kernel in ~/.ipython
  • Bring up redis and run 'jupyter console --kernel redis'
  • The console comes up and works fine, except the deprecation warnings

@marmalodak
Copy link
Author

Not too far off.

I created a virtual environment. In it I install Jupyterhub, in addition to the items from requirements.text.
The server is then started with something like:

export IPYTHONDIR
source ${PROJECT_ROOT}/venv/jupyter-venv/bin/activate
${PROJECT_ROOT}/venv/jupyter-venv/bin/jupyterhub --ip=0.0.0.0                                         \
                                                 --port=80                                            \
                                                 --base-url=/                                         \
                                                 --debug                                              \
                                                 --log-level=0                                        \
                                                 --Spawner.notebook_dir=${NOTEBOOKS_DIR}              \
                                                 --config=${JUPYTER_CONFIG}                           \
                                                 --db=sqlite://${PROJECT_ROOT}/root/jupyter/jupyterhub.sqlite

This enables me to create a systemd unit file:

[Unit]
Description=Start the ipython service which is available at http://qa-ipython
After=network.target

[Service]
Type=simple
ExecStart=/e2e/bin/qa-jupyter-notebook-service-start
ExecStop=kill $(pidof /e2e/bin/qa-jupyter-notebook-service-start) 
StandardError=syslog
StendardOut=syslog

[Install]
WantedBy=multi-user.target

After this is all running, I have a multi-user server that I can share with the team. Obviously you'll have to customize the paths to suit you.

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

2 participants