Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to install or update jupyterlab extensions #16029

Open
Wickdhub opened this issue Mar 20, 2024 · 15 comments · Fixed by #16064
Open

Impossible to install or update jupyterlab extensions #16029

Wickdhub opened this issue Mar 20, 2024 · 15 comments · Fixed by #16064
Assignees
Labels
bug os:windows Issues related to Windows operating system use
Milestone

Comments

@Wickdhub
Copy link

Description

When I try to install or update any jupyterlab extensions, I got the error:

Error: ERROR: Could not open requirements file: [Errno 13] Permission denied: 'C:\Users\Username\AppData\Local\Temp\tmp7rvtr5s7'

(The name of the file change each time I'm trying to install an extension)
And in fact this file does not exist in that folder.

Reproduce

  1. Go to jupyterlab
  2. On the left panel Click on extension manager and try to install iny extension
  3. See error Error: ERROR: Could not open requirements file: [Errno 13] Permission denied: 'C:\Users\Username\AppData\Local\Temp\tmp7rvtr5s7'

Expected behavior

Install the extension

Context

  • Operating System and version: Windows 10
  • JupyterLab version: 4.1.5 (but also didn't work with my old version 3.6.x I believe)
Troubleshoot Output
sys.executable:
        C:\Python310\python.exe

sys.version:
3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]

platform.platform():
Windows-10-10.0.19045-SP0

where jupyter:
C:\Python310\Scripts\jupyter.exe
C:\Users\Thomas\AppData\Local\Programs\Python\Python310\Scripts\jupyter.exe

Command Line Output
[D 2024-03-19 01:37:23.476 ServerApp] Searching ['C:\\Users\\Thomas\\.jupyter', 'C:\\Users\\Thomas\\AppData\\Roaming\\Python\\etc\\jupyter', 'C:\\Python310\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
[D 2024-03-19 01:37:23.477 ServerApp] Looking for jupyter_config in C:\ProgramData\jupyter
[D 2024-03-19 01:37:23.477 ServerApp] Looking for jupyter_config in C:\Python310\etc\jupyter
[D 2024-03-19 01:37:23.478 ServerApp] Looking for jupyter_config in C:\Users\Thomas\AppData\Roaming\Python\etc\jupyter
[D 2024-03-19 01:37:23.478 ServerApp] Looking for jupyter_config in C:\Users\Thomas\.jupyter
[D 2024-03-19 01:37:23.480 ServerApp] Looking for jupyter_server_config in C:\ProgramData\jupyter
[D 2024-03-19 01:37:23.481 ServerApp] Looking for jupyter_server_config in C:\Python310\etc\jupyter
[D 2024-03-19 01:37:23.481 ServerApp] Looking for jupyter_server_config in C:\Users\Thomas\AppData\Roaming\Python\etc\jupyter
[D 2024-03-19 01:37:23.482 ServerApp] Looking for jupyter_server_config in C:\Users\Thomas\.jupyter
[D 2024-03-19 01:37:23.483 ServerApp] Loaded config file: C:\Users\Thomas\.jupyter\jupyter_server_config.py
[W 2024-03-19 01:37:23.484 ServerApp] ServerApp.iopub_data_rate_limit config is deprecated in 2.0. Use ZMQChannelsWebsocketConnection.iopub_data_rate_limit.
[D 2024-03-19 01:37:23.525 LabApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'iopub_data_rate_limit': 100000000, 'log_level': 'DEBUG', 'root_dir': 'C:/Users/Thomas/Desktop/', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}, 'ZMQChannelsWebsocketConnection': {'iopub_data_rate_limit': 100000000.0}}
[I 2024-03-19 01:37:23.527 ServerApp] jupyterlab | extension was successfully linked.
[D 2024-03-19 01:37:23.537 NotebookApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'iopub_data_rate_limit': 100000000, 'log_level': 'DEBUG', 'root_dir': 'C:/Users/Thomas/Desktop/', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}, 'ZMQChannelsWebsocketConnection': {'iopub_data_rate_limit': 100000000.0}}
[I 2024-03-19 01:37:23.539 ServerApp] nbclassic | extension was successfully linked.
[I 2024-03-19 01:37:24.126 ServerApp] notebook_shim | extension was successfully linked.
[D 2024-03-19 01:37:24.128 ServerApp] Config changed: {'ExtensionApp': {'log_level': 'DEBUG'}, 'ZMQChannelsWebsocketConnection': {'iopub_data_rate_limit': 100000000.0}, 'NotebookApp': {}, 'ServerApp': {'iopub_data_rate_limit': 100000000, 'log_level': 'DEBUG', 'root_dir': 'C:/Users/Thomas/Desktop/', 'jpserver_extensions': }}
[D 2024-03-19 01:37:24.128 ServerApp] Ignoring min_open_files_limit because the limit cannot be adjusted (for example, on Windows)
[I 2024-03-19 01:37:25.446 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-03-19 01:37:25.495 LabApp] JupyterLab extension loaded from C:\Python310\lib\site-packages\jupyterlab
[I 2024-03-19 01:37:25.496 LabApp] JupyterLab application directory is C:\Python310\share\jupyter\lab
[I 2024-03-19 01:37:25.498 LabApp] Extension Manager is 'pypi'.
[D 2024-03-19 01:37:25.498 LabApp] Plugins in PyPIExtensionManager will managed on the sys_prefix level
[D 2024-03-19 01:37:25.518 LabApp] Extensions list will be fetched from https://pypi.org/pypi.
[D 2024-03-19 01:37:25.518 LabApp] Plugins in PluginManager will managed on the sys_prefix level
[I 2024-03-19 01:37:25.523 ServerApp] jupyterlab | extension was successfully loaded.

| | | |_ __ | | | | ___
| || | ' / / _ | / -)
_/| ./_
,_,|____|
|_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[I 2024-03-19 01:37:25.536 ServerApp] nbclassic | extension was successfully loaded.
[I 2024-03-19 01:37:25.537 ServerApp] Serving notebooks from local directory: C:/Users/Thomas/Desktop/
[I 2024-03-19 01:37:25.538 ServerApp] Jupyter Server 2.13.0 is running at:
[I 2024-03-19 01:37:25.538 ServerApp] http://localhost:8888/lab?token=29792d63705b112f0db698982b68968d826786a586159ad0
[I 2024-03-19 01:37:25.539 ServerApp] http://127.0.0.1:8888/lab?token=29792d63705b112f0db698982b68968d826786a586159ad0
[I 2024-03-19 01:37:25.539 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2024-03-19 01:37:25.770 ServerApp]

To access the server, open this file in a browser:
    file:///C:/Users/Thomas/AppData/Roaming/jupyter/runtime/jpserver-10648-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/lab?token=29792d63705b112f0db698982b68968d826786a586159ad0
    http://127.0.0.1:8888/lab?token=29792d63705b112f0db698982b68968d826786a586159ad0

[D 2024-03-19 01:37:27.255 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:27.265 LabApp] Using contents: services/contents
[D 2024-03-19 01:37:27.272 LabApp] 200 GET /lab?token=[secret] (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 17.95ms
[D 2024-03-19 01:37:27.402 ServerApp] Path jupyterlab_pygments\static\remoteEntry.5cbb9d2323598fbda535.js served from C:\Python310\share\jupyter\labextensions\jupyterlab_pygments\static\remoteEntry.5cbb9d2323598fbda535.js
[D 2024-03-19 01:37:27.404 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/remoteEntry.5cbb9d2323598fbda535.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.99ms
[D 2024-03-19 01:37:27.406 ServerApp] Path jupyterlab-execute-time\static\remoteEntry.1b02858205859542399c.js served from C:\Python310\share\jupyter\labextensions\jupyterlab-execute-time\static\remoteEntry.1b02858205859542399c.js
[D 2024-03-19 01:37:27.407 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/remoteEntry.1b02858205859542399c.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.99ms
[D 2024-03-19 01:37:27.825 ServerApp] Path jupyterlab-execute-time\static\vendors-node_modules_date-fns_esm_index_js.bb5155b17a678353747a.js served from C:\Python310\share\jupyter\labextensions\jupyterlab-execute-time\static\vendors-node_modules_date-fns_esm_index_js.bb5155b17a678353747a.js
[D 2024-03-19 01:37:27.827 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/vendors-node_modules_date-fns_esm_index_js.bb5155b17a678353747a.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 3.02ms
[D 2024-03-19 01:37:27.831 ServerApp] Path jupyterlab-execute-time\static\lib_index_js.fb167f2c6a5a431067b7.js served from C:\Python310\share\jupyter\labextensions\jupyterlab-execute-time\static\lib_index_js.fb167f2c6a5a431067b7.js
[D 2024-03-19 01:37:27.832 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/lib_index_js.fb167f2c6a5a431067b7.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 2.99ms
[D 2024-03-19 01:37:27.833 ServerApp] Path jupyterlab-execute-time\static\style_index_js.e3248b207ee2564c1324.js served from C:\Python310\share\jupyter\labextensions\jupyterlab-execute-time\static\style_index_js.e3248b207ee2564c1324.js
[D 2024-03-19 01:37:27.834 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/style_index_js.e3248b207ee2564c1324.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:27.835 ServerApp] Path jupyterlab_pygments\static\568.1e2faa2ba0bbe59c4780.js served from C:\Python310\share\jupyter\labextensions\jupyterlab_pygments\static\568.1e2faa2ba0bbe59c4780.js
[D 2024-03-19 01:37:27.836 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/568.1e2faa2ba0bbe59c4780.js?v=1e2faa2ba0bbe59c4780 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 5.95ms
[D 2024-03-19 01:37:27.837 ServerApp] Path jupyterlab_pygments\static\747.67662283a5707eeb4d4c.js served from C:\Python310\share\jupyter\labextensions\jupyterlab_pygments\static\747.67662283a5707eeb4d4c.js
[D 2024-03-19 01:37:27.838 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/747.67662283a5707eeb4d4c.js?v=67662283a5707eeb4d4c (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 7.95ms
[D 2024-03-19 01:37:27.960 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:27.963 ServerApp] Found kernel python3 in C:\Users\Thomas\AppData\Roaming\jupyter\kernels
[D 2024-03-19 01:37:28.027 ServerApp] 200 GET /api/kernelspecs?1710808647957 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 66.85ms
[D 2024-03-19 01:37:28.029 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.030 ServerApp] 200 GET /api/me?1710808647957 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.95ms
[D 2024-03-19 01:37:28.034 ServerApp] Found kernel python3 in C:\Users\Thomas\AppData\Roaming\jupyter\kernels
[D 2024-03-19 01:37:28.036 ServerApp] 200 GET /api/kernelspecs?1710808648010 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:28.041 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.042 ServerApp] 101 GET /api/events/subscribe?token=[secret] (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 9.97ms
[D 2024-03-19 01:37:28.043 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.044 ServerApp] 200 GET /api/sessions?1710808647966 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 11.97ms
[D 2024-03-19 01:37:28.046 ServerApp] 200 GET /api/me?1710808648010 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 8.98ms
[D 2024-03-19 01:37:28.046 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.047 ServerApp] 200 GET /api/kernels?1710808647965 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 9.98ms
[D 2024-03-19 01:37:28.048 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.268 LabApp] 200 GET /lab/api/settings?1710808647963 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 231.38ms
[D 2024-03-19 01:37:28.275 LabApp] Using contents: services/contents
[D 2024-03-19 01:37:28.276 LabApp] 200 GET /lab/workspaces/auto-f?reset (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 231.38ms
[D 2024-03-19 01:37:28.278 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.279 ServerApp] Found kernel python3 in C:\Users\Thomas\AppData\Roaming\jupyter\kernels
[D 2024-03-19 01:37:28.282 ServerApp] 200 GET /api/kernelspecs?1710808648030 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:28.283 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.284 ServerApp] 200 GET /api/me?1710808648033 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:28.459 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.463 ServerApp] 200 GET /api/config/jupyterlabapputilsextensionannouncements?1710808648456 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:28.575 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/remoteEntry.1b02858205859542399c.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 2.03ms
[D 2024-03-19 01:37:28.577 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/remoteEntry.5cbb9d2323598fbda535.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.96ms
[D 2024-03-19 01:37:28.715 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/vendors-node_modules_date-fns_esm_index_js.bb5155b17a678353747a.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.99ms
[D 2024-03-19 01:37:28.717 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/lib_index_js.fb167f2c6a5a431067b7.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 0.99ms
[D 2024-03-19 01:37:28.720 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/747.67662283a5707eeb4d4c.js?v=67662283a5707eeb4d4c (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.99ms
[D 2024-03-19 01:37:28.722 ServerApp] 304 GET /lab/extensions/jupyterlab_pygments/static/568.1e2faa2ba0bbe59c4780.js?v=1e2faa2ba0bbe59c4780 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 3.99ms
[D 2024-03-19 01:37:28.723 ServerApp] 304 GET /lab/extensions/jupyterlab-execute-time/static/style_index_js.e3248b207ee2564c1324.js (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 3.99ms
[D 2024-03-19 01:37:28.772 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.773 ServerApp] Found kernel python3 in C:\Users\Thomas\AppData\Roaming\jupyter\kernels
[D 2024-03-19 01:37:28.776 ServerApp] 200 GET /api/kernelspecs?1710808648767 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:28.777 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.778 ServerApp] 200 GET /api/me?1710808648768 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 1.00ms
[D 2024-03-19 01:37:28.782 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.992 LabApp] 200 GET /lab/api/settings?1710808648772 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 213.43ms
[D 2024-03-19 01:37:28.995 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.996 ServerApp] 101 GET /api/events/subscribe?token=[secret] (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 2.99ms
[D 2024-03-19 01:37:28.996 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:28.998 ServerApp] 200 GET /api/sessions?1710808648776 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 3.99ms
[D 2024-03-19 01:37:28.999 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.000 ServerApp] 200 GET /api/kernels?1710808648776 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 5.99ms
[D 2024-03-19 01:37:29.001 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.002 ServerApp] Found kernel python3 in C:\Users\Thomas\AppData\Roaming\jupyter\kernels
[D 2024-03-19 01:37:29.005 ServerApp] 200 GET /api/kernelspecs?1710808648779 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.98ms
[D 2024-03-19 01:37:29.005 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.006 ServerApp] 200 GET /api/me?1710808648782 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 4.99ms
[D 2024-03-19 01:37:29.156 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.264 ServerApp] 200 GET /lab/api/translations/default?1710808649149 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 111.73ms
[D 2024-03-19 01:37:29.277 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.281 ServerApp] 200 GET /api/config/jupyterlabapputilsextensionannouncements?1710808649274 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 3.99ms
[D 2024-03-19 01:37:29.300 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.373 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.374 ServerApp] Using contents: services/contents
[D 2024-03-19 01:37:29.396 ServerApp] Path favicon.ico served from C:\Python310\lib\site-packages\jupyter_server\static\favicon.ico
[D 2024-03-19 01:37:29.397 ServerApp] Path style/bootstrap.min.css served from C:\Python310\lib\site-packages\jupyter_server\static\style\bootstrap.min.css
[D 2024-03-19 01:37:29.398 ServerApp] Path style/bootstrap-theme.min.css served from C:\Python310\lib\site-packages\jupyter_server\static\style\bootstrap-theme.min.css
[D 2024-03-19 01:37:29.399 ServerApp] Path style/index.css served from C:\Python310\lib\site-packages\jupyter_server\static\style\index.css
[D 2024-03-19 01:37:29.400 ServerApp] Path logo/logo.png served from C:\Python310\lib\site-packages\jupyter_server\static\logo\logo.png
[W 2024-03-19 01:37:29.403 ServerApp] 404 GET /lsp/status?1710808649369 (e4e9f011c23543de8cbbd3fd15bc1d23@::1) 30.92ms referer=http://localhost:8888/lab/workspaces/auto-f?reset
[D 2024-03-19 01:37:29.409 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.414 ServerApp] Accepting token-authenticated request from ::1
[D 2024-03-19 01:37:29.415 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.416 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.418 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.418 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.419 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.420 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.420 ServerApp] Reading path from disk:
[D 2024-03-19 01:37:29.420 LabApp] Node v20.11.1

@Wickdhub Wickdhub added the bug label Mar 20, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Mar 20, 2024
@krassowski
Copy link
Member

This might have been introduced in #15650 which added writing to a temporary file to create a constraints file before installation:

with tempfile.NamedTemporaryFile(mode="w+", delete=True) as fconstraint:
fconstraint.write(f"jupyterlab=={__version__}")
fconstraint.flush()
cmdline = [
sys.executable,
"-m",
"pip",
"install",
"--no-input",
"--quiet",
"--progress-bar",
"off",
"--constraint",
fconstraint.name,
]

If that is the case, potential solutions include passing requirements on the command line instead, or figuring out why the Python executable does not have access to temporary file created from the parent process

@krassowski
Copy link
Member

or figuring out why the Python executable does not have access to temporary file created from the parent process

This is interesting pypa/pip-audit#646:

A temporary file created in this temp folder loses its permissions on Windows when it is closed (this doesn't happen in Unix). The pip install process opens and closes one or two temporary files several times during the installation process, and thus, permissions on the temp file are lost and Windows throws an error.

So apparently we should not use tempfile.NamedTemporaryFile on Windows, unless we want to do something like in pypa/pip-audit#647 / https://stackoverflow.com/a/63173312/6646912.

Of note, the Python docs states:

Opening the temporary file again by its name while it is still open works as follows:

  • On POSIX the file can always be opened again.
  • On Windows, make sure that at least one of the following conditions are fulfilled:
    • delete is false
    • additional open shares delete access (e.g. by calling os.open() with the flag O_TEMPORARY)
    • delete is true but delete_on_close is false. Note, that in this case the additional opens that do not share delete access (e.g. created via builtin open()) must be closed before exiting the context manager, else the os.unlink() call on context manager exit will fail with a PermissionError.

So, it might be that we could just switch delete=False and then manually delete the file?

It is tempting to just get rid of the temporary file and specify the arguments on CLI (which means using requirements rather than --constraint).

@krassowski
Copy link
Member

Or someone could address the underlying issue of package downgrades in pip itself, see: pypa/pip#10807 (comment)

@JasonWeill JasonWeill added os:windows Issues related to Windows operating system use and removed status:Needs Triage Applied to new issues that need triage labels Mar 26, 2024
@fcollonval fcollonval self-assigned this Mar 27, 2024
@krassowski
Copy link
Member

@Wickdhub and anyone else are you able to apply the patch from #16064 and see if this helps?

@krassowski krassowski added this to the 4.0.x milestone Apr 2, 2024
@Wickdhub
Copy link
Author

Wickdhub commented Apr 3, 2024

@krassowski I'm not really sure what I have to do, did I have to change the code and compile it myself or can I just modify the pypi file (if it exist) in my computer?

@krassowski
Copy link
Member

can I just modify the pypi file (if it exist) in my computer

If you feel comfortable doing so you can try it (I do that sometimes myself), but please be aware that this might break your installation if you make a typo and you may need to reinstall.

The alternative is installing from source which might be a bit challenging but you would basically clone my branch and follow https://jupyterlab.readthedocs.io/en/latest/developer/contributing.html#installing-jupyterlab

@Wickdhub
Copy link
Author

Wickdhub commented Apr 3, 2024

Ok, now I have no error when installing, however I got this meessage:

image

and even after refreshing I can't see the extension, it is however installed in Python/Lib/site-packages

@krassowski
Copy link
Member

This is good progress! I think we can merge that PR then. What extension did you try to install? Some extensions may require restarting JupyterLab altogether to work.

@Wickdhub
Copy link
Author

Wickdhub commented Apr 3, 2024

I tried by hazard on the 2 first ones 310-notebook and abirami-hide-code.

I think the issue comes from other stuff, in fact my jupyterlab labextension list shows C:\Python\share\jupyter\labextensions
and thoses extensions are well installed in site-packages but not installed in the labextensions folder.

The (?) on pypi manager says: Extension installation path: C:\Python

@krassowski
Copy link
Member

Frankly I do not know if these are functional extensions. Can you try to install one of the extensions from https://github.com/jupyterlab-contrib/ (I would suggest one which has status "ready" badge), e.g. https://github.com/jupyterlab-contrib/jupyterlab-spreadsheet-editor or https://github.com/jupyterlab-contrib/jupyterlab-favorites or https://github.com/jupyterlab-contrib/spellchecker

@Wickdhub
Copy link
Author

Wickdhub commented Apr 3, 2024

I have still the exact same issue with these 2 extensions

@krassowski
Copy link
Member

Reopening as there may be more work needed to get it to work.

@krassowski krassowski reopened this Apr 3, 2024
@Wickdhub
Copy link
Author

Wickdhub commented Apr 3, 2024

I don't know if this is linked to this issue or other stuff, but now I still have the extension active but they are not showing in the left panel:
image
Also when I try to download via extensions command line I have this:
image

@pjsgsy
Copy link

pjsgsy commented May 31, 2024

Same here Download, try to add a single extension, get permission denied from the windows temp folder location
image

@krassowski
Copy link
Member

@Wickdhub to install spellchecker extension from command line please run pip install jupyterlab-spellchecker or conda install -c conda-forge jupyterlab-spellchecker as in https://github.com/jupyterlab-contrib/spellchecker. Do NOT install using jupyter labextension install as it is deprecated (as the command says).

@pjsgsy can you confirm which JupyterLab version do you see this error with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug os:windows Issues related to Windows operating system use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants