Python2 becomes more and more of a problem. We now fail to install spyder, see #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 about jupyter? Will it just work when we use
python3 -m pip install jupyter
Possibly easiest would be to do
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
sudo update-alternatives --set python /usr/bin/python3.6
before doing anything python-like at all.
@casperdcl @bathomas what do you think?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.![]()
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"
},
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
update-alternatives for a system library is risky; it may break something else. jupyter will "just work" (with a warning about selecting a new kernel in case the name changes)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
also I presume ubuntu 20.04LTS will default to py3.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
This seems unrelated. Best to try again after a reboot of the VM.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
@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?)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
We're using CMake 3.13. We should probably by using FindPython now, which would then default to using python3 apparently.
See CCPPETMR/SIRF-SuperBuild#313
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
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
jupyterThen 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)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()