jupyter_server 2.0 seems to break showHiddenFiles in JupyterLab - jupyter-lab

I am using JupyterLab with:
jupyterlab=3.5.1
jupyter_server=1.23.3
and I have the following config:
{
// File Browser
// #jupyterlab/filebrowser-extension:browser
// File Browser settings.
// *****************************************
// Show hidden files
// Whether to show hidden files
"showHiddenFiles": true
}
as well as:
c.ContentsManager.allow_hidden = True
Everything is working fine and I can see all hidden files in the JupyterLab UI.
Now, if I just update jupyter server to the new version jupyter_server=2.0.1, I don't see anymore the hidden file (the config is the same).
Is there some incompatibility between jupyterlab and jupyter server for the hidden file or the config need to be done in a different way ?
It seems that jupyter server is causing some trouble with package like jupytext and other.
I am expecting the following:

Everything was fixed and I am using now the following update tags :
jupyter_server 2.0.5
jupyter-core 5.1.1
(jupyterlab 3.5.2)
For more info you can look here: ticket

Related

Wrong Version of Django Running in Virtual Environment

I have two versions of Python installed (OS: Windows 10). The original version is 3.8.2. I installed 3.11.1 and did not have it added to PYTHONPATH. I created a virtual env using py -m venv .env. Despite using py, the virtual environment runs both Python 3.8.2 and 3.11.1 depending on whether I type python or py. Inside the virtual environment I installed a newer version of Django (4.1.5) using py -m pip install django, which successfully installed Django within the Python311 folder on my system. However, no django-admin.py file was installed, just django-admin.exe. To ensure I created my project using the newer version of Django, I navigated to the folder where the django-admin.exe file exists and ran the following:
py django-admin.exe startproject <*project_name*> <*full_path_to_project_folder*>
The settings.py file shows it was created using Django 4.1.5, but whenever I start my project it runs using Django 3.0.4 (the pre-existing version). I am starting it using py manage.py runserver, to ensure Python 3.11.1 is being used. I have tried it both inside and outside my virtual environment. I have added the python311\Scripts folder at the top of my Path environment variables, and have uninstalled and reinstalled Django 4.1.5.
At this point I am at a loss as to why I cannot get the newer version of Django to run. I have tried numerous Google and SO searches and have not found any similar issues or anything to point me in the right direction. I wondered whether it might have to do with django-admin.py not being installed with Django 4.1.5, so I looked for the django-admin.py file in the Django 4.1.5 source code with no success. I then saved the django-admin.py file from the 3.0.4 version into the python311/Scripts folder updated to reference the python311\python.exe, but the system still loads the one from the python38/Scripts folder. Hoping for some additional ideas to try.
EDIT: After adding 3.11.1 to Path and reinstalling Django I deleted and recreated the Django project. The system still wouldn't find the django-admin.py I added to the python311\Scripts folder, even using the full path, so I used the following command to create the project:
py \full\path\to\django-admin.exe startproject project_name .
Same issue: The project was created with Django 4.1.5, but runserver still uses 3.0.4.
I was able to ultimately solve the problem by adding the \python311 folder to the Path (leaving off \Scripts). So I now have both \python311 and \python311\Scripts on the Path in addition to the original \python38 and \python38\Scripts locations. Runserver now runs with Django 4.1.5.

VSCode terminal is using the wrong python version

I have a new mac with python 3 installed from homebrew and visual studio code. I am not a python person by default I tend to use java but wanted to try a project for fun.
Just my terminal in VSCode has a system install of python 3.8 version that I am not using I want to use my brew install version as shown in screen shots. if I do echo $path it shows correct, my mac terminal shows correct and my VSCode python plugin has the correct version showing. I have rebooted several times in case it was cached.
I want to use the brew version 3.9.7. My project is failing to load imports such as "import requests" I assume because of this. The import fail error is.
Import "requests" could not be resolved from sourcePylancereportMissingModuleSource
I have installed and uninstalled requests many times always through VSCode command line.
Perhaps the values in $PATH of VS Code is in a different order than that of Terminal.app.
See https://github.com/microsoft/vscode/issues/70248 for more informations.
You can simply set "terminal.integrated.inheritEnv": false. This works well for me.
Try putting the following in settings.json:
"terminal.integrated.env.osx": {
"PATH": ""
}
Save the file, close any terminal window and restart VS Code.
You can read more here.
Go into VS Code settings: Code->Preferences->Settings. Type the following in the search box:
terminal.integrated.inheritEnv": false
Uncheck the option box beside the setting "whether new shells should inherit their environment from VS Code..." to set it to False.
Restart VS code and try again, you should have the same version of python as on your standard terminal.

ModuleNotFoundError: There is not a labextensions at . when exec "jupyter labextension develop . --overwrite" in terminal

Summary of the problem.
I am developing an extension of jupyterlab.
The extension has both frontend part and server(python) part.
However, after I install the extension according to tutorial and readMe.md. The jupyterlab cannot load the server. I try to run the commands again, run into the problem of:
ModuleNotFoundError: There is not a labextensions at .
when executing
"jupyter labextension develop . --overwrite" in terminal.
The tutorial:
https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html#extension-tutorial
The README.md likes:
# Clone the repo to your local environment
# Change directory to the athena_jupyter directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable athena_jupyter
# Rebuild extension Typescript source after making changes
jlpm run build
What I have tried.
2.1 follow the readme.txt several times.
2.2 create a new conda environment, the initial project worked. However, when I add something, rebuild, it failed again.
2.3 remove something about the jupyterlab extension config. because it has other warning log: my extension is not found.
2.4 in fact, i meet this problem server times. I tried lot of things and it is solved, but i don't know what's the problem and cannot get a summary solution to this problem, and this time i cannot solve it.
Thanks in advance!
This error can be reproduced by removing the _jupyter_labextension_paths from the extension's __init__.py.
E.g.,something like this should be in the __init__.py file.
def _jupyter_labextension_paths():
return [{
"src": "labextension",
"dest": data["name"]
}]
Perhaps newer versions of the cookiecutter produce a project that does not depend on the presence of _jupyter_labextension_paths in __init__.py: https://github.com/jupyterlab/jupyterlab-module-federation/issues/61

JupyterLab configuration file - editing jupyter_notebook_config.py has no effect

I'm using JupyterLab version 1.2.3
I have generated a ~/.jupyter/jupyter_notebook_config.py file by running jupyter-lab --generate-config.
At the bottom of the file, I have added the line c.InteractiveShell.ast_node_interactivity = "all".
However, when I run jupyter lab, the notebook still behaves as if the default value for InteractiveShell.ast_node_interactivity were set.
Is any other step required to make the configuration file active? Or how can I "debug" to better understand what the problem is?
You must generate a config file in IPython with the command:
$ ipython profile create
the created file would be ipython_kernel_config.py
On this file, you must make the changes indicated

How to change Jupyter launch from file to URL?

I installed Python 3.7 from Windows Store, it runs perfectly. I successfully installed Jupyter and other packages with pip from cmd.
The thing is when I run Jupyter (python -m notebook) it says
and automaticaly opens the browser with an ERR_FILE_NOT_FOUND page. Opening the notebook by copy-pasting the URLs works just as expected, so how can I tell Jupyter to run by default the URL instead of the file?
At my end, the file does not open either due to security settings of Chromium (ERR_ACCESS_DENIED).
There's a config parameter which controls how the browser gets access to jupyter: NotebookApp.use_redirect_fileBool (cf. jupyter docs).
In order to change this, create a config by jupyter notebook --generate-config and edit the config file: uncomment and replace the value of line #c.NotebookApp.use_redirect_file = True by c.NotebookApp.use_redirect_file = False. On next start of jupyter, the browser is started using the http URL instead of the file.
HTH
The solution above works (UBUNDU). You just have to bare in mind a few thinks:
1st: If you use jupyter notebook you need to craete this file jupyter notebook --generate-config and look for the line c.NotebookApp.use_redirect_file = True .
If you use jupyter-lab (as I do) you need to use this command jupyter-lab --generate-config . Also, in jupyter-lab you need to find this line c.ServerApp.use_redirect_file = True . In both cases this True needs to become False .
PS. I wanted to add it as a comment but I was not able to do so due to reputation or something.
2nd: It is given in the previous answer but its easy to be missed: you need to uncomment the line (remove the "#" at the start of the line)

Resources