Closed KrisThielemans closed 3 years ago
A complication might be that the SIRF-exercises notebooks had to include python2 kernel name, even though some of them have python3, e.g.
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
update-alternatives
for a system library is risky; it may break something else. jupyter
in python3
will "just work" (with a warning about selecting a new kernel in case the name changes)
also I presume ubuntu 20.04LTS will default to py3.
So I tested with a jupyter notebook based on python2 and the following code was issued by the terminal:
[IPKernelApp] ERROR | Failed to create history session in /home/sirfuser/.ipython/profile_default/history.sqlite. History will not be saved.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/IPython/core/history.py", line 549, in __init__
self.new_session()
File "</usr/local/lib/python2.7/dist-packages/decorator.pyc:decorator-gen-22>", line 2, in new_session
File "/usr/local/lib/python2.7/dist-packages/IPython/core/history.py", line 60, in needs_sqlite
return f(self, *a, **kw)
File "/usr/local/lib/python2.7/dist-packages/IPython/core/history.py", line 575, in new_session
NULL, "") """, (datetime.datetime.now(),))
OperationalError: database is locked
This seems unrelated. Best to try again after a reboot of the VM.
@casperdcl you say
jupyter in python3 wll just work
After python3 -m pip install jupyter
, I presume that will override an existing python2
install, and that the new one wlil have python3
as default kernel? (A volunteer for trying this?)
The other thing though is to make sure that CMake
picks up python3
in the build. That might need a change in UPDATE.sh
etc.
We're using CMake 3.13. We should probably by using FindPython
now, which would then default to using python3
apparently.
After python3 -m pip install jupyter, I presume that will override an existing python2 install, and that the new one wlil have python3 as default kernel?
Assuming
1) there's also still a py2 jupyter installed
2) The launch command is just jupyter
3) the launch is not within a conda/venv
Then it would depend on the order in PATH whether jupyter py2
or 3
took precedence. Otherwise there would be no conflict.
For our purposes (vm/docker) we can definitely fully control this (incl. e.g. setting a default py2 kernel for py3 jupyter)
some other things to think about when upgrading:
I've removed the pin to nbstripout
and spyder
with python3, which you run with spyder3
.
please create the PR.
closed with #170
Python2 becomes more and more of a problem. We now fail to install spyder, see https://github.com/CCPPETMR/CCPPETMR_VM/issues/121.
Sadly, on Ubuntu 18.04, default
python
is still python2.7. I guess we can easily tell the SuperBuild to use python3. But what aboutjupyter
? Will it just work when we usePossibly easiest would be to do
before doing anything python-like at all.
@casperdcl @bathomas what do you think?