Comments (7)
Can you show the contents of /home/user/.local/share/jupyter/kernels/python2/kernel.json
?
from ipykernel.
Sure.
{
"display_name": "Python 2",
"language": "python",
"argv": [
"python",
"-m",
"ipykernel",
"-f",
"{connection_file}"
]
}
from ipykernel.
Looks like this is causing issues here. What would be a solution in this case? I want to use libraries installed in the active conda environment but also keep both Python 2 and 3 available.
Thanks
from ipykernel.
Yes, so python
in kernelspec will always refer to the Python of the notebook server's environment. This is why IPython (following Python's own rewrite of the #!
line of scripts) hardcodes the full path to sys.executable at install time. By manually changing this, as was recommended in jupyter/notebook#397 is explicitly requesting the behavior you are seeing. If you want it to launch with a specific Python, you must specify the absolute path. If you want it to launch with Python 3 or legacy Python, but be sensitive to the env, then you can use python2
or python3
.
from ipykernel.
Thanks. Then what do you recommend for new users? Create an environment for Python 2 and another for Python 3, install ipykernel in both, and point the path in kernel.json to the appropriate location inside the environment?
By the way, using python2
might not work because it uses /usr/bin/python
and can't find ipykernel
.
from ipykernel.
I wouldn't suggest that new users modify any kernel.json. I would recommend that they run python2 -m ipykernel install
and python3 -m ipykernel install
one time, and be done. They can do this in envs if they wish, or not. If they choose to create new envs and want to install kernels for those envs, run python -m ipykernel --display-name 'Python <env>'
in the env. This can be done on env creating with virtualenvwrapper, if it's a common enough action.
from ipykernel.
Got it. python -m ipykernel --display-name 'Python <env>'
looks really useful. Thanks.
from ipykernel.
Related Issues (20)
- jupyther
- Should ipykernel align kernel SVG with the one used by JupyterLab?
- CI failing with INTERNALERROR when skipping tests
- Jupyter notebook cell instruction after asyncio.run is not executing with 6.28.0v of ipykernel HOT 4
- Can not install ipykernel HOT 2
- Better cell magic by removing some of the syntax limitations
- python 3.11 debugpy error messages HOT 3
- Directing output of out external threads/processes to specific cells HOT 1
- Qt eventloop interferes with asyncio.call_later in _abort_queues HOT 7
- Incorrect stack traceback when try except finally is used in jupyter notebooks with pandas
- Feature request: enable editing_mode = ‘vi’ for a ZMQTerminalIPythonApp console
- TypeError: '>=' not supported between instances of 'str' and 'datetime.datetime' HOT 3
- Release 7.0 HOT 5
- "ModuleNotFoundError: No module named 'comm'" when running 'python -m ipykernel install'
- Output [ ] Alone HOT 2
- Compatibility with pytest 8 HOT 1
- Different child termination behavior during Kernel shutdown on Posix and Windows systems HOT 1
- Windows: ipykernel install prefix not usable for c:\programdata\jupyter
- AnyIO commit breaks Matplotlib display in separate windows HOT 2
- Restore to previous state with copy-on-write HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipykernel.