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

When python-shell-interpreter is set to "jupyter", conda is unable to change the environment of the interpreter. #135

Open
zhenhua-wang opened this issue Nov 5, 2022 · 4 comments
Labels

Comments

@zhenhua-wang
Copy link

Hi,

conda.el works very well when python-shell-interpreter is set to "python3". However, when using "jupyter" as python-shell-interpreter , the jupyter console is still executed in the base environment even if I have called conda-env-activate.

Below are my configs for python shell interpreter

(setq python-shell-interpreter "jupyter"
      python-shell-interpreter-args "console --simple-prompt"
      python-shell-prompt-detect-failure-warning nil)
(add-to-list 'python-shell-completion-native-disabled-interpreters
             "jupyter")
@necaris
Copy link
Owner

necaris commented Nov 6, 2022 via email

@zhenhua-wang
Copy link
Author

zhenhua-wang commented Nov 6, 2022

Thanks for your reply. Before conda activate, which -a jupyter gives

Screenshot_20221106_122501

After running conda activate tf, the jupyter in the tf does show up

Screenshot_20221106_122413

@necaris
Copy link
Owner

necaris commented Nov 7, 2022

I suspect you want to use the pythonic helper functions for your use-case -- as suggested at https://github.com/pythonic-emacs/pythonic#project-settings , if you set the pythonic-interpreter variable it may behave better:

(setq pythonic-interpreter "jupyter")

Note that conda.el changes the Python environment using python-shell-virtualenv-root, which is provided by python.el in the core Emacs distribution, and I'm not 100% sure how to make sure jupyter's path is correctly calculated.

If this doesn't work for you, please reopen and we can figure out how to do this!

@zhenhua-wang
Copy link
Author

Thanks for your help! The variable python-shell-interpreter is also part of the core emacs, so I also have no idea why this won't work. As for the pythonic package, I am not sure what it does as oppose to core emacs, so I don't plan to use it.

I do find that Ipython console ((setq python-shell-interpreter "ipython")) works very well with conda.el. Since ipython is almost the same as jupyter, I'll just use this console.

@necaris necaris added the bug label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants