How to Update the Installed Widgets - jupyter-lab

When I started Jupyter Lab from the cmd prompt within a python virtual environment folder, I noticed the Jupyter startup process display that
three of the Jupyter widgets are outdated. There was no display message describing how to update these widgets.
Therefore, the question is: How to update the Jupyter widgets?
I searched for a solution and did not find any.
The Startup code w/ three widget outdated messages at bottom
(ML3-2Gxa7Dh2) C:\pythonVE\ML3>jupyter lab
[I 11:26:05.773 LabApp] JupyterLab extension loaded from c:\python37\lib\site-packages\jupyterlab
[I 11:26:05.773 LabApp] JupyterLab application directory is c:\python37\share\jupyter\lab
[W 11:26:05.793 LabApp] Error loading server extension jupyterlab_latex
Traceback (most recent call last):
File "c:\python37\lib\site-packages\notebook\notebookapp.py", line 1572, in init_server_extensions
mod = importlib.import_module(modulename)
File "c:\python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'jupyterlab_latex'
[W 11:26:05.840 LabApp] JupyterLab server extension not enabled, manually loading...
[I 11:26:05.881 LabApp] JupyterLab extension loaded from c:\python37\lib\site-packages\jupyterlab
[I 11:26:05.881 LabApp] JupyterLab application directory is c:\python37\share\jupyter\lab
[I 11:26:05.883 LabApp] Serving notebooks from local directory: C:\pythonVE\ML3
[I 11:26:05.883 LabApp] The Jupyter Notebook is running at:
[I 11:26:05.883 LabApp] http://localhost:8888/
[I 11:26:05.884 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 11:26:07.540 LabApp] 302 GET /lab (::1) 1.00ms
[I 11:26:16.232 LabApp] 302 POST /login?next=%2Flab (::1) 1.00ms
[W 11:26:47.607 LabApp] The extension "#jupyter-widgets/jupyterlab-manager" is outdated.
[W 11:26:47.609 LabApp] The extension "#jupyterlab/latex" is outdated.
[W 11:26:47.611 LabApp] The extension "#jupyterlab/toc" is outdated.
[I 11:26:48.411 LabApp] Build is up to date
|[I 11:26:54.426 LabApp] Kernel started: 5ba63189-6fa9-40cc-87ea-eea2d869
Widgets seem to work within the Jlab notebook.

I had a similar problem which I could solve by typing the following command:
jupyter labextension update --all
With
jupyter labextension list
I could show me the extension including those that were outdated and the command to update them was shown there, too.
Since you're writing “cmd prompt” I expect you are using Windows, so maybe your results may vary. Because I'm unsing Linux and cannot test it on Windows, I don't know if npm behaves the same.
BTW: With
jupyter labextension --help
you can get further help on labextensions including the hint on “install” which might be interesting for you, too, because your output also complains about a missing LaTeX extension.

Related

How to create kivy applications for desktop in Windows?

Good afternoon people.
Once again trying to package kivy for DESKTOP on WINDOWS 10 and to no avail!
I had a lot of errors that I managed to solve without disturbing the order in the groups but this one is phoda with ph.
1 - I create the exe using Auto_py_to_exe and before there is any comment that I should use pyinstaller, I tell you, the same thing happens!
2 - My pyinstaller script is as follows:
pyinstaller --noconfirm --onefile --console --name "TeuCu" --add-data "C: /Users/Elias/Desktop/kv_inventario/inventario/main.kv ;." --add-data "C: / Users / Elias / Desktop / kv_inventario / inventario / images; images /" "C: /Users/Elias/Desktop/kv_inventario/inventario/main.py"
3 - The error is exactly like this, when running the application after it is created it returns this error:
[CRITICAL] [Window] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - Exception: SDL2: Unable to load image
File "kivy\core\__init__.py", line 70, in core_select_lib
File "kivy\core\window\window_sdl2.py", line 152, in __init__
File "kivy\core\window\__init__.py", line 982, in __init__
File "kivy\core\window\window_sdl2.py", line 311, in create_window
File "kivy\core\window\__init__.py", line 1268, in create_window
File "kivy\graphics\instructions.pyx", line 783, in kivy.graphics.instructions.RenderContext.__init__
File "kivy\core\image\__init__.py", line 561, in __init__
File "kivy\core\image\__init__.py", line 754, in _set_filename
File "kivy\core\image\__init__.py", line 460, in load
File "kivy\core\image\__init__.py", line 223, in __init__
File "kivy\core\image\img_sdl2.py", line 47, in load
[CRITICAL] [App] Unable to get a Window, abort.
My solution that could possibly work would be this tip that I found in kivy issues:
Kivy issues
This took me to the post below and translating it asks to uninstall the pillow and reinstall with the wheel
python3 -m pip3 uninstall pillow
python3 -m pip3 install --use-wheel pillow
But it didn't.
I would like your help. Who managed to generate an application for Windows with kivy
I'm using Windows 10 to package.
This error is common - Here are some helpful links:
Kivy not working (Error: Unable to find any valuable Window provider.)
Python app not working after using pyinstaller but doesn't give any errors
https://github.com/kivy/kivy/issues/6342
https://github.com/pal1000/save-legacy-intel-graphics
Kivy does not detect OpenGL 2.0
Windows- Pyinstaller Error "failed to execute script " When App Clicked
Unable to get a window, abort
https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html
https://github.com/kivy/kivy/issues/6276
If none of these work, I also made a video on packaging a kivy app to a single exe for Windows: https://www.youtube.com/watch?v=k9Hx0q5Sopg
Please let me know if you succeed. Cheers!

Fixing jupyter notebook on AWS

I'm trying to set up jupyter notebook to run on AWS, I'm followed this guide - https://medium.com/#alexjsanchez/python-3-notebooks-on-aws-ec2-in-15-mostly-easy-steps-2ec5e662c6c6.
It worked but I now realise that every time I launch jupyter on my local machine, it asks for a password, also the password saved no longer works effectively locking me out of jupyter:
I presume its because I set up the ssh connection to port 8888 which is what jupyter uses by default. However, I've removed the ssh config file in step 10 but no change.
I'm stumped as to why jupyter no longer launches correctly, does anyone have any ideas on how I correct this?
I've also noticed that a token is given when launching jupyter from an EC2 instance
but in my case non is given
#Launching jupyter in notebook from EC2 enviornment
(base) [ec2-user#ip-172-31-59-151 ~]$ jupyter lab --no-browser
[I 14:49:49.917 LabApp] JupyterLab extension loaded from /home/ec2-user/anaconda3/lib/python3.8/site-packages/jupyterlab
[I 14:49:49.917 LabApp] JupyterLab application directory is /home/ec2-user/anaconda3/share/jupyter/lab
[I 14:49:49.919 LabApp] Serving notebooks from local directory: /home/ec2-user
[I 14:49:49.919 LabApp] Jupyter Notebook 6.1.4 is running at:
[I 14:49:49.919 LabApp] http://localhost:8888/
[I 14:49:49.920 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs' on intel dev cloud

I am unable to install packages in my intel dev cloud. I tried installing packages using pip from bash shell. I also created a new conda environment and tried installing packages there. It didn't work either. I think the problem is with permissions in file system. The error says "read-only file system" as you can see.
Any suggestions can greatly help.
P.S: I am trying to install keras and sklearn
please check the error log below.
Installing collected packages: keras
Exception:
Traceback (most recent call last):
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs'
I think the problem is with permissions in file system. The error says "read-only file system"
Yes, you correctly diagnosed the problem.
You need to choose a writable filesystem to write the installed files to.
You may find the df and mount commands helpful. Start with man df.
With the guidance of #J_H I found out the answer.
pip usually tries to install packages globally, which is not allowed on shared platforms like Intel DevCloud. Hence we need to install packages for single user that is you.
Hence
pip install --user keras
installs keras in your home directory and you are not restricted to write in your home directory. Problem Solved!

Jupyter Extension Installation Failed: Error says 'terminado' wasn't found, but I should already have it

I've tried to install jupyter extensions following the instruction here.
The first step named 'Install the python package' in the instruction was succeeded.
But the second one named 'Install javascript and css files' was failed.
I executed jupyter contrib nbextension install --user as instructed, but an error occured.
The error says: pkg_resources.DistributionNotFound: The 'terminado>=0.8.1' distribution was not found and is required by notebook. (All traceback shown is as below.)
But I confirmed that I've already installed 'terminado' v0.8.2 package, which was installed via pip.
How can I handle this problem? Is the problem solely that jupyter command does not know where the 'terminado' is installed? Or is the problem more serious?
All the error message is as below:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-contrib", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'terminado>=0.8.1' distribution was not found and is required by notebook
I'm using macOS Catalina (but same problem appeared on Mojave.
Summary
The problem is, as it may be turned out with seeing the error message, that the jupyter contrib command uses python2, not python3 which is my preference.
Problem
The usage of python2 by the command was caused by the shebang of /usr/local/bin/jupyter-contrib file.
The shebang was #!/usr/bin/python, which means that it specified jupyter-contrib used python interpreter which located on /usr/bin/python which is python2 on my machine (and many other Mac machine, maybe).
Hence you should specify python3 with the shebang rather than python2.
Solution
First, get your python3 installation path like this:
$ which python3
Copy the returned path.
Open the /usr/local/bin/jupyter-contrib file. Note that this file is read-only but you have to rewrite it, so you should open it with sudo:
$ sudo vim /usr/local/bin/jupyter-contrib
Rewrite the shebang on the 1st line. Shebang may now be like this:
#!/usr/bin/python
where it specifies python2 as its interpreter. You should rewrite the path to python3's path which you copied at step 1:
#!{{Paste your python3's path}}
Save the file.
That's it.
Now jupyter-contrib uses python3.
So jupyter contrib nbextension install --user command should succeeds.

Environment Munging in Anaconda, PyCharm, and Jupyter Notebooks? No such file or directory: 'conda'

Regular PyCharm, Anaconda and Jupyter user, but for the first time I'm starting a project that would benefit with having them all play together:
I have a correctly configured Anaconda environment running within PyCharm, however when I try to launch ipynb notebooks (that work perfectly well in jupyter notebook from within PyCharm, I get...
/home/bolster/anaconda3/bin/python3.5 /home/bolster/anaconda3/bin/jupyter-notebook --no-browser --ip 127.0.0.1 --port 8888
[W 12:33:12.515 NotebookApp] Unrecognized JSON config file version, assuming version 1
[W 12:33:12.519 NotebookApp] Config option `matplotlib` not recognized by `NotebookApp`.
[W 12:33:12.521 NotebookApp] Config option `matplotlib` not recognized by `NotebookApp`.
Traceback (most recent call last):
File "/home/bolster/anaconda3/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/home/bolster/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/bolster/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 595, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/home/bolster/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 74, in catch_config_error
return method(app, *args, **kwargs)
File "/home/bolster/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 1069, in initialize
self.init_configurables()
File "/home/bolster/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 837, in init_configurables
parent=self,
File "/home/bolster/anaconda3/lib/python3.5/site-packages/nb_conda_kernels/manager.py", line 19, in __init__
specs = self.find_kernel_specs() or {}
File "/home/bolster/anaconda3/lib/python3.5/site-packages/nb_conda_kernels/manager.py", line 129, in find_kernel_specs
self.conda_info = self._conda_info()
File "/home/bolster/anaconda3/lib/python3.5/site-packages/nb_conda_kernels/manager.py", line 29, in _conda_info
p = subprocess.check_output(["conda", "info", "--json"]
File "/home/bolster/anaconda3/lib/python3.5/subprocess.py", line 629, in check_output
**kwargs).stdout
File "/home/bolster/anaconda3/lib/python3.5/subprocess.py", line 696, in run
with Popen(*popenargs, **kwargs) as process:
File "/home/bolster/anaconda3/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/home/bolster/anaconda3/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'conda'
I have a hunch that this is because PyCharm isn't attempting to launch the notebook in a "real" user environment and as such isn't getting my $PATH imports (in .profile), however as this isn't a "Run Configuration" I can't see any way to "point" the IDE to look in the right path for the conda executable.
However if I add a link to the conda executable to /usr/bin/, it works, but this is an order of hackery on a collaborative project that I'm not exactly happy with.
Is there a way to force PyCharm to look in the right place or at least update the internal-global environment variables to avoid seriously telling collaborators they need to link from their userland environment to the root bins?
Any application started from the terminal will inherit all the properties from the terminal. If you start the PyCharm the non-terminal way then the $PATH defined in the .profile won't be inherited and so the default $PATH.
Started the PyCharm from the shell and then $PATH from the .profile was inherited. Now, PyCharm is able to found conda in the path.
Another way is to create a .sh file in the /etc/profile.d folder with the PATH variable. These variables are system wide. So, there is no need to start PyCharm from the terminal now.
The reason for such a behavior and alternate solutions are specified in this StackOverflow post.
Hope this helps!

Resources