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

After installing new version, cannot find python environment #727

Open
rclUPC opened this issue Nov 3, 2023 · 10 comments
Open

After installing new version, cannot find python environment #727

rclUPC opened this issue Nov 3, 2023 · 10 comments
Labels

Comments

@rclUPC
Copy link

rclUPC commented Nov 3, 2023

Description

After installing new version of Jupyterlab Desktop (version 4.0.7-1), I cannot start new session since python environment is not found, even when it has been installed (bundled environment).

Reproduce

  1. Launch Jupyterlab Desktop, either from terminal (jlab) or with menu.
  2. See error 'Python environment not found'
    image

Context

  • Operating System and version: Linux Mint 21.2 Cinnamon
  • JupyterLab-Desktop version: 4.0.7-1
  • Installer: .deb
Logs (required for issues with loading, server and startup) The log file in .config/jupyterlab-desktop/logs/main.log gives the following information:

[2023-11-03 19:06:09.898] [error] Required Python packages not found in the environment path "/home/robert/.config/jupyterlab-desktop/jlab_server/". Versions found are: jupyterlab: NOT-FOUND. You can install missing packages using 'conda install -c conda-forge -y "jupyterlab>=3.0.0"'.
[2023-11-03 19:06:10.439] [error] Required Python packages not found in the environment path "/home/robert/.config/jupyterlab-desktop/jlab_server/". Versions found are: jupyterlab: NOT-FOUND. You can install missing packages using 'conda install -c conda-forge -y "jupyterlab>=3.0.0"'.
[2023-11-03 19:06:11.585] [error] Failed to create free server Error: No default environment found!
at /opt/JupyterLab/resources/app.asar/build/out/main/registry.js:224:32
[2023-11-03 19:06:11.587] [error] (node:513779) UnhandledPromiseRejectionWarning: Error: No default environment found!
at /opt/JupyterLab/resources/app.asar/build/out/main/registry.js:224:32
(Use jupyterlab-desktop --trace-warnings ... to show where the warning was created)
[2023-11-03 19:06:11.588] [error] (node:513779) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

I have installed jupterlab in the enviroment, but the error persists.
Copy link

welcome bot commented Nov 3, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@rclUPC
Copy link
Author

rclUPC commented Nov 3, 2023

Version 4.0.5-1 gives same error.
Version 4.0.2-1 works fine.

@JasonWeill
Copy link

Are you still seeing this with a newer version? Does the problem persist after uninstalling and installing JupyterLab Desktop?

@rclUPC
Copy link
Author

rclUPC commented Dec 13, 2023

Hi, As far as I know, there is no newer version than 4.0.7-1. Still the same problem.

@mbektas
Copy link
Member

mbektas commented Dec 17, 2023

hi @rclUPC can you try these on your system terminal. does it work? any error messages?

jlab env activate # assumes you have installed the bundled environment already
jupyter lab

@mrinalraghupathi
Copy link

mrinalraghupathi commented Jan 2, 2024

I am not sure if this is related but I have a a similar issue. I have jupyterlab installed in a base conda environemtn and I can run jupyter lab from the terminal as a web application without any issues.

When I launched JLD I was prompted to create a custom environment and I setup the python path to point to python in the base conda environment.

However, JLD will not start now

JLD version: 4.0.7-1 (although this happens on older versions as well)
Mac OS: 13.4.1 running M1 processor
JL version in environment: 4.0.8 (although same happens for any version of JL I've tried, e.g. 3.6.3)

Log file (I have replaced my actual username with a placeholder USERNAME for posting, but on my machine it is just my real username). Note that the first log entry are from a fresh install of JLD and then after being prompted I updated the python path.

[2024-01-02 12:23:00.017] [error] Failed to get environment info at path '/usr/bin/python3'. SyntaxError: Unexpected token 'x', "xcrun: err"... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfo (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:285:34)
    at async Registry._resolveEnvironment (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:159:21)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:78
    at async Promise.all (index 2)
    at async Registry._resolveEnvironments (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:30)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:111:30
[2024-01-02 12:23:01.276] [error] Failed to get environment info at path '/Users/{USERNAME}/miniconda3/bin/python3'. SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfo (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:285:34)
    at async Registry._resolveEnvironment (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:159:21)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:78
    at async Promise.all (index 0)
    at async Registry._resolveEnvironments (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:30)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:111:30
[2024-01-02 12:23:01.276] [error] Failed to get environment info at path '/Users/{USERNAME}/miniconda3/envs/ds/bin/python'. SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfo (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:285:34)
    at async Registry._resolveEnvironment (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:159:21)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:78
    at async Promise.all (index 3)
    at async Registry._resolveEnvironments (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:148:30)
    at async /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:111:30
[2024-01-02 12:23:01.277] [error] Failed to create free server Error: No default environment found!
    at /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:192:32
[2024-01-02 12:23:01.277] [error] (node:64080) UnhandledPromiseRejectionWarning: Error: No default environment found!
    at /Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:192:32
(Use `JupyterLab --trace-warnings ...` to show where the warning was created)
[2024-01-02 12:23:01.277] [error] (node:64080) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[2024-01-02 12:24:50.789] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)
[2024-01-02 12:25:23.293] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)
[2024-01-02 12:26:07.129] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)
[2024-01-02 12:27:42.130] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)
[2024-01-02 12:29:03.069] [error] Error: EPERM: operation not permitted, chmod '/Applications/JupyterLab.app/Contents/Resources/app/jlab'
    at Object.chmodSync (node:fs:1888:3)
    at setupJLabCommand (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:130:12)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:178:9)
[2024-01-02 12:29:04.231] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)
[2024-01-02 12:29:15.944] [error] Error: EPERM: operation not permitted, chmod '/Applications/JupyterLab.app/Contents/Resources/app/jlab'
    at Object.chmodSync (node:fs:1888:3)
    at setupJLabCommand (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:130:12)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:178:9)
[2024-01-02 12:29:17.144] [error] SyntaxError: Unexpected token 'I', "Intel MKL "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Registry.getEnvironmentInfoSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:311:30)
    at Registry._resolveEnvironmentSync (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:169:26)
    at new Registry (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/registry.js:68:33)
    at new JupyterApplication (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/app.js:175:26)
    at App.<anonymous> (/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/main.js:180:22)

settings.json

{
  "pythonPath": "/Users/{USERNAME}/miniconda3/bin/python",
  "serverEnvVars": {}
}

output of jlab env info is

Default Python environment path:
  "/Users/{USERNAME}/miniconda3/" [exists]
Bundled Python environment installation path:
  "/Users/{USERNAME}/Library/jupyterlab-desktop/jlab_server" [not found]
Base conda environment path:
  "/Users/{USERNAME}/miniconda3" [exists]
System Python path:
  "/Users/{USERNAME}/miniconda3/bin/python3" [exists]

output of jlab env list is

Discovered Python environments:
  None

User set Python environments:
  None

@mrinalraghupathi
Copy link

hi @rclUPC can you try these on your system terminal. does it work? any error messages?

jlab env activate # assumes you have installed the bundled environment already
jupyter lab

I tried this and it did work in my case, i.e. it launched a jupyterlab web app.

@rclUPC
Copy link
Author

rclUPC commented Jan 3, 2024

Hi, and Happy New Year!!
@mbektas, I tried and I get first a message about the module pyrsistent missing. I installed it with pip install, but it is still not working:

  File "/home/robert/.config/jupyterlab-desktop/jlab_server/bin/jupyter-lab", line 6, in <module>
    from jupyterlab.labapp import main
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyterlab/__init__.py", line 8, in <module>
    from .handlers.announcements import (
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyterlab/handlers/announcements.py", line 14, in <module>
    from jupyter_server.base.handlers import APIHandler
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyter_server/base/handlers.py", line 24, in <module>
    from jupyter_events import EventLogger
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyter_events/__init__.py", line 3, in <module>
    from .logger import EVENTS_METADATA_VERSION, EventLogger
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyter_events/logger.py", line 19, in <module>
    from .schema import SchemaType
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyter_events/schema.py", line 18, in <module>
    from .validators import draft7_format_checker, validate_schema
  File "/home/robert/.config/jupyterlab-desktop/jlab_server/lib/python3.8/site-packages/jupyter_events/validators.py", line 44, in <module>
    JUPYTER_EVENTS_SCHEMA_VALIDATOR = Draft7Validator(
TypeError: __init__() got an unexpected keyword argument 'registry'

@rclUPC
Copy link
Author

rclUPC commented Jan 3, 2024

BTW, if I use another python env (f.i., anaconda3) it works fine.

@xgdgsc
Copy link
Contributor

xgdgsc commented Apr 19, 2024

How does it search for jupyterlab?
I have python installed at D:\Program Files\Python312-arm64\python.exe but the installed jupyterlab are at C:\Users\UserNAME\AppData\Roaming\Python\Python312-arm64\ and it cannot find jupyterlab. I also tried sym linking site-packages and jupyter.exe jupyter-lab.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants