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
How to configure emacs-jupyter on MacOS with Python 3 and venv? #257
Comments
I've been using doom-emacs which comes with a layer in I think spacemacs should also have a layer. If you are new to emacs, then Spacemacs would be a good recommendation. If you choose to install doom-emacs, after installation of that system, go to +jupyter ; ipython/jupyter support for babel Then run in a terminal: ~/.emacs.d/bin/doom sync And restart emacs, to install all the packages and it should set everything up for you. |
If your problem is only the python2 rather than the python 3 then you could follow this tutorial: |
I have the same issue with spacemacs and doom-emacs. Python 2 comes installed with Mac OS. Python 3 I have installed from Homebrew and I'm using it with direnv/venv. For some reason emacs-jupyter defaults to Mac OS native Python 2, and I don't know how to change that. ob-ipython picks up a correct Python 3 binary. I launch Emacs from command line where my PATH is set up appropriately:
So the default
So my question is: how does emacs-jupyter decide where to find |
Hmm, that's a bit weird as it should be working in that case: ❯ echo $PATH
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/TeX/texbin # Export to pdf from org mode ❯ which python
/usr/local/bin/python Seems like /usr/local/bin/python --version |
Relevant lines in Seems like it references |
@tavurth Yes, emacs-jupyter is picking up In
which is at odds with my
where the As I've said, I'm new to Emacs and I'm not sure what to do about it. How can I configure Emacs or ( |
I'm not sure of the exact specifics behind getting You can do that as follows: unlink /usr/local/bin/python
ln -s /usr/local/bin/python3 /usr/local/bin/python Sorry I can't be of more help with the specific Edit: This fixed my issue almost a year later 🤣 |
See exec-path-from-shell. for more info. You need your python (or jupyter) executable of choice to be in the PATH, and you need Emacs to know the path. There is no magic here. |
@tavurth I can't unlink the default @dangom I already have a suitable python executable in my |
@lostman, this solved the issue for me:
Update: Sorry, forgot to include the following:
|
I have a similar problem on Fedora 32. When I try to evaluate a jupyter-python source block, the echo area shows: However my system python is python 3. And when I evaluate a python org source block with:
It, correctly, tells me it uses python3. Which it should be as the value of my |
I have Python 3 installed using
venv
but when I attempt to run ajupyter-python
code block on Org mode I seeWhich is then followed by
I can't figure out how to point Emacs or
emacs-jupyter
at the right Python version.I'm new to Emacs and just trying it out for Org + Python. So pardon my ignorance!
The text was updated successfully, but these errors were encountered: