-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added a workaround for Jupyter notebooks #7990
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
Conversation
Added a link to https://github.com/mapio/jupyter-virtualenv-osx that can solve the issue for Jupyter notebook users.
@Carreau Do you mind having a look at this PR as an OSX user and an IPython/Jupyter developer? |
In a discussion on Reddit https://www.reddit.com/r/Python/comments/5qwzif/mapiojupytervirtualenvosx_a_tool_to_install_a/ a supposedly easier solution is suggested. Unfortunately, I've tested it and in my opinion it works only with Python 3, or with IPython (and not Jupyter notebooks). In any case @Carreau should probably double check in case I'm wrong. |
@mapio That solution is already in our f.a.q http://matplotlib.org/devdocs/faq/osx_framework.html#virtualenv venv does indeed not have this issue which virtualenv has but is not available for python 2 |
@jenshnielsen yes, and I missed that the OP edited the comment admitting that it does not work for Python 2.7. So I think that my edit to the documentation will offer a simple solution for OS X users that want to run Jupyter under Python 2.7. |
One of the drawback of this (in particular the instruction , not the script itself) is it will install jupyter in all the environments if you use several, while what most people want (or should do) when installing jupyter is have the notebook server installed once (either in the system/root env/another env, I don't care, up to them) and then install likely only ipykernel in their env. That is due to the confusion that jupyter does not need to be installed on the Python that are used when you import libraries, so technically you don't really care whether the jupyter use a framework Python or not. For the sake of argument Jupyter could be written in Go or Haskell, and what you care is where IPython (technically IPykernel and dependencies) are installed. Also at some point in the future probably around 2020, we'll start requiring python 3 for some components of the notebook server (we do already for JupyterHub). So users will need to have both a Python 3 and a Python 2 env to run Python 2 code in the notebooks. Hence the distinction will need to understood at some point[1]. I must point out that the repo is 23h old also. In the other hand it seem to solve people problems, and @mapio took the time to write this script. I'm guessing many users won't deal with multiple envs, so for them this may "just work" and make the experience much better. It would still be nice to figure out how to make the installation clean without having to deal with scripts in all the places though. This might be a first step. [1]: There've been some discussion with the conda for a "Python 3 env" to be able to be a "dependendency" on a Python 2 package, so that |
I do agree @Carreau that the confusion about Jupyter must be cleared – and I'd like you to help me better understand the situation here. The only "new" thing the script does is to use the This works both if you install Jupyter in the virtualenv, or not — and, for what matters, even if you install the IPython kernel in the virtualenv or not. Presently the only dependency of the script is on But if a user wants to use Jupyter, he must have such package installed (in the system, or virtualenv, package directory). I'll try to edit the |
That's it @Carreau, mapio/jupyter-virtualenv-osx@2590f65 I've reworded the I'd love if you consider this for merging :-) |
@Carreau Do you mind re-reviewing the PR? (more specifically whether the improvements to the script solve the issue you have mentioned) |
Seem better this way. +1. Thanks @mapio. |
DOC: Add dcos for Jupyter notebooks with virtualenv on OSX
backported to v2.0.0-doc as d0676a9 |
Added a link to https://github.com/mapio/jupyter-virtualenv-osx that can solve the issue for Jupyter notebook users.