Skip to content

Jupyter Server Not Found (executable not in PATH) #238

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

Closed
alejandroschuler opened this issue Sep 23, 2021 · 50 comments
Closed

Jupyter Server Not Found (executable not in PATH) #238

alejandroschuler opened this issue Sep 23, 2021 · 50 comments
Assignees
Labels

Comments

@alejandroschuler
Copy link

alejandroschuler commented Sep 23, 2021

Description

When starting jupyterlab_app, I get the message:

Jupyter Server Not Found
We were unable to launch a Jupyter server, which is a prerequisite for JupyterLab Native. If Jupyter is installed as a python module, but the python executable is not in your PATH, specify the executable location below. Otherwise, try installing or updating Jupyter. The Jupyter notebook version must be 4.3.0 or greater.

Despite a) having a working jupyter-lab installation that I can spin up from the terminal and which appears in the browser, b) having the python executable in my path, and c) having the requisite version of jupyter.

When I manually point jupyterlab_app to the python executable (/Users/aschuler/.pyenv/shims/python) via the CHOOSE PATH it spins the icon again for a moment and then returns the same "Server Not Found" message.

Context

I am running python through pyenv, which may be the issue here. Relevant information:

aschuler@Alejandros-MacBook-Air ~ % pyenv versions
  system
* 3.9.6 (set by /Users/aschuler/.pyenv/version)
aschuler@Alejandros-MacBook-Air ~ % echo $PATH    
/Users/aschuler/.pyenv/shims:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
aschuler@Alejandros-MacBook-Air ~ % jupyter --version
jupyter core     : 4.7.1
jupyter-notebook : 6.4.0
qtconsole        : 5.1.1
ipython          : 7.26.0
ipykernel        : 6.0.3
jupyter client   : 6.1.12
jupyter lab      : 3.1.13
nbconvert        : 6.1.0
ipywidgets       : 7.6.3
nbformat         : 5.1.3
traitlets        : 5.0.5
aschuler@Alejandros-MacBook-Air ~ % which python
/Users/aschuler/.pyenv/shims/python
aschuler@Alejandros-MacBook-Air ~ % which jupyter-lab
/Users/aschuler/.pyenv/shims/jupyter-lab

(MK): Extra details from title: jupyterlab_app fails to start on MacOS 11.5.2 with (pyenv issue?)

@welcome
Copy link

welcome bot commented Sep 23, 2021

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! 🎉

@alejandroschuler
Copy link
Author

When I manually point jupyterlab_app to the python executable (/Users/aschuler/.pyenv/shims/python) via the CHOOSE PATH it spins the icon again for a moment and then returns the same "Server Not Found" message.

The problem occurs even if I point jupyterlab_app to the "true" python executable (not the pyenv shim), i.e. /Users/aschuler/.pyenv/versions/3.9.6/bin/python3.9.

@pybokeh
Copy link

pybokeh commented Sep 23, 2021

Same thing happens with me, except I'm on Windows 10 OS. For some reason, it keeps thinking it should search for the python.exe located in the C:\JupyterLab folder despite me manually pointing it to the python.exe of the Python virtual env that has jupyterlab and server installed.

EDIT: I am using just venv module for my virtual environments, not pyenv.

@krassowski
Copy link
Member

I think that jupyter_app was designed to be started from the icon file provided which takes care of selecting appropriate environment. For example on Ubuntu/GNOME this is an icon showing up in the application grid:

jupyterlab-app

I expect that on Windows there is an icon in the start menu, and something similar on Mac. When you start jupyterlab-app from the menu entry/desktop icon does this error show up too?

@alejandroschuler
Copy link
Author

@krassowski I was starting jupyter from the mac spotlight search (cmd-space -> "jupyter..." -> enter). I think this is the same as using the icon but I also just tried finding the icon in the application folder manually and double clicking and the result is the same.

@mbektas
Copy link
Member

mbektas commented Sep 25, 2021

@alejandroschuler @pybokeh JupyterLab App bundles a Python environment and uses that environment explicitly. Clicking launcher icons are the right way to launch as @krassowski noted.

  • On Mac have you installed JupyterLab App to default install destination (/Application/JupyterLab.app) or user directory ~/Applications/JupyterLab.app. Then your Python environment would be located in /Applications/JupyterLab.app/Contents/Resources/jlab_server or ~/Applications/JupyterLab.app/Contents/Resources/jlab_server. Can you confirm that is the case?
  • On Windows make sure you don't change the default installation path of C:\JupyterLab. Your Python environment will be in C:\JupyterLab\resources\jlab_server. Please confirm that is the case. There is a known issue on Windows that subsequent launches of JupyterLab might sometimes fail after first launch as in "Jupyter Server Not Found" on Windows 10 #241. The workaround is to run the app as administrator. Can you check if that solves your problem?

@alejandroschuler
Copy link
Author

@mbektas yes I can see /Applications/JupyterLab.app/Contents/Resources/jlab_server. What can I do to make the desktop app run the server from my installation?

@krassowski
Copy link
Member

Is your goal to run a kernel from your installation, or to run a server from your installation? While I see a case for the former, I don't see when the latter would be required.

@alejandroschuler
Copy link
Author

alejandroschuler commented Sep 25, 2021

Is your goal to run a kernel from your installation, or to run a server from your installation? While I see a case for the former, I don't see when the latter would be required.

Ah, I see what you mean @krassowski. I would be more than content to run a kernel for my installation. That would suffice for packages installed via terminal pip to be accessible from jupyter, right?

Either way, it seems I can't even do that at the moment (i.e. the app fails to start even its own bundled server!)

@alejandroschuler
Copy link
Author

Moreover, if the app is using its own installation of jupyter, why does the error message inform me that I should try to install or update jupyter?? That seems needlessly confusing.

@krassowski
Copy link
Member

The error message was added a long time ago when the things worked differently and is probably worth replacing with something better (please feel welcome to contribute!). This app was just revived, please bear with us 🐻 while it is going through its infancy issues.

As for re-using kernels from other virtual environments/installations, it depends on the kernel, but when using IPython (ipykernel) you can:

  1. Activate your old virtual environment with the ipython kernel you want to use
  2. Execute ipython kernel install --name "My New Kernel" --user
  3. Confirm that it was installed by running jupyter kernelspec list
  4. Restart JupyterLab-App
  5. See new kernel icon with My New Kernel label show up in the launcher
  6. Try to import a package installed only in that kernel to verify that it works ok

Now, it works for me on Ubuntu but I don't have Windows/Mac to test it. It would be great if you could follow these steps and let us know how it goes.

@krassowski
Copy link
Member

There is also nb_conda_kernels and jupyter_environment_kernels which allow for auto-discovery of kernels and maybe we should consider including those by default. This discussion is in #169 (comment).

@alejandroschuler
Copy link
Author

@krassowski I'd love to try that, but, as I said, I can't get the app to even start the server. Based on my understanding, I can't really do anything about the kernel without a running server in the first place, right?

@flashypepo
Copy link

I also can't do anything, because starting JupyterLab-Desktop stops at "Jupyter Server not found". I've tried to select the installed Anaconda's python executabele, I'll see the "jlab_server" but cannot select it after "choose path". I've also checked MacOS (dammed)Privacy rules, no success. I'll wait until later. Sorry, JupyterLab Desktop looks promising but does not work for me yet.
Configuration: MacOS 11.6. JupyterLab Desktop installed in ~/Application folder (earlier I installed it in /Application folder and had same result).

@krassowski krassowski changed the title jupyterlab_app fails to start on MacOS 11.5.2 with "JupyterServer Not Found" (pyenv issue?) Jupyter Server Not Found (executable not in PATH) Oct 31, 2021
@chipmuenk
Copy link

Coming from #321:

  1. on Windows, have you tried installing as an administrator and selecting "install for All users"?
  2. on Ubuntu, how did you install it? Did you use the GUI software manager, gdebi, dpkg, or apt?

1.: Yes, I tried "install for all users" with the same result. I have installed several python versions via pyenv on this machine, maybe this has a side effect. I had hoped for a nice sandboxed environment that doesn't interact with existing Python installations (and doesn't require a previous python installation).

  1. I downloaded the debian installer and installed it with the default GUI software manager (as probably most students would do). I also tried using the GDebi Installer which fails silently; if it installs something it doesn't show up under /opt and it also doesn't appear in the GUI launcher.

@chipmuenk
Copy link

One more comment: Last week, about 15 students in my DSP course had installed Jupyterlab Desktop without a problem, making me feel a little stupid. One major difference could be that they didn't have previous installations of Python and / or JupyterLab while my path contains:

c:\users\chris\.pyenv\pyenv-win\bin; c:\users\chris\.pyenv\pyenv-win\shims; 
C:\Users\Chris\AppData\Local\Programs\Python\Python38\Scripts\;
C:\Users\Chris\AppData\Local\Programs\Python\Python38\;

Are there known issues with parallel Python / JupyterLab installations?

@Kaisershmarren
Copy link

Dear all,
the same problem happens to me when I'm trying to select an alternative Python Environment through the selector on the bottom bar:
Nuova nota
Immagine 18-11-21 alle 09 21
Immagine 18-11-21 alle 09 23

My environment is:

MacOSX 12.0.1
JupiterLabDesktop 3.2.3-1
Anaconda+Anaconda Navigator2.1.1

For the creation of virtual environment I followed the instruction on:
https://github.com/jupyterlab/jupyterlab-desktop/blob/master/user-guide.md#changing-the-python-environment-used-by-jupyterlab-desktop
I created a virtual environment through the anaconda navigator with python 3.6.13 and installed the packages through command line

@krassowski krassowski self-assigned this Nov 18, 2021
@krassowski
Copy link
Member

@Kaisershmarren what is the version of JupyterLab installed in your mobile_net_ssd2 environment? Could you please start JupyterLab in that environment and paste the output that gets printed on startup in the console, including the line with the token (you may want to replace the token with a placeholder).

@Kaisershmarren
Copy link

Dear @krassowski,
the version of JupyterLab is the 3.2.1:

Name: jupyterlab
Version: 3.2.1
Summary: JupyterLab computational environment
Home-page: https://jupyter.org
Author: Jupyter Development Team
Author-email: [email protected]
License: UNKNOWN
Location: /Users/max/opt/anaconda3/envs/mobile_net_ssd2/lib/python3.6/site-packages
Requires: jinja2, packaging, ipython, jupyterlab-server, tornado, jupyter-core, jupyter-server, nbclassic
Required-by:

When you're saying to start JupiterLab are you meaning to start jupyter-server ?
If so, this is the console output:

[I 2021-11-18 19:15:04.997 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-11-18 19:15:05.506 ServerApp] nbclassic | extension was successfully linked.
[I 2021-11-18 19:15:05.600 LabApp] JupyterLab extension loaded from /Users/max/opt/anaconda3/envs/mobile_net_ssd2/lib/python3.6/site-packages/jupyterlab
[I 2021-11-18 19:15:05.600 LabApp] JupyterLab application directory is /Users/max/opt/anaconda3/envs/mobile_net_ssd2/share/jupyter/lab
[I 2021-11-18 19:15:05.605 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-11-18 19:15:05.613 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-11-18 19:15:05.613 ServerApp] Serving notebooks from local directory: /Users/max/Library/Application Support/jupyterlab-desktop
[I 2021-11-18 19:15:05.613 ServerApp] Jupyter Server 1.4.1 is running at:
[I 2021-11-18 19:15:05.613 ServerApp] http://localhost:8888/?token=xxxxxxx
[I 2021-11-18 19:15:05.613 ServerApp] or http://127.0.0.1:8888/?token=xxxxxxx
[I 2021-11-18 19:15:05.613 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-11-18 19:15:05.619 ServerApp]

To access the server, open this file in a browser:
    file:///Users/max/Library/Jupyter/runtime/jpserver-792-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=xxxxxxx
 or http://127.0.0.1:8888/?token=xxxxxxx

I don't know if it could be useful, but I also managed to start JupiterNotebook (of course it's not nice to use as the desktop version... but it's working...) from Anaconda Navigator (in the section of environments):
Search Environments

@krassowski
Copy link
Member

krassowski commented Nov 18, 2021

That's very useful, thank you. Could you do this once more for me but execute the following command:

/Users/max/opt/anaconda3/envs/mobile_net_ssd2/bin/python -m jupyterlab --no-browser --JupyterApp.config_file_name=''

please?

@Kaisershmarren
Copy link

Kaisershmarren commented Nov 18, 2021

I've launched the command... and this is the output... there is an error at the end...

The Jupyter Server.

This launches a Tornado-based Jupyter Server.

Subcommands

Subcommands are launched as jupyter-server cmd [args]. For information on
using subcommand 'cmd', do: jupyter-server cmd -h.

list
List currently running notebook servers.
stop
Stop currently running Jupyter server for a given port
password
Set a password for the Jupyter server.
extension
Work with Jupyter server extensions

Options

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--debug
Set debug level for the extension and underlying server applications.
--generate-config
generate default config file
-y
Answer yes to any questions instead of prompting.
--allow-root
Allow the server to be run from root user.
--no-browser
Prevent the opening of the default url in the browser.
--autoreload
Autoreload the webapp
Enable reloading of the tornado webapp and all imported Python packages
when any changes are made to any Python src files in server or
extensions.
--script
DEPRECATED, IGNORED
--no-script
DEPRECATED, IGNORED
--core-mode
Start the app in core mode.
--dev-mode
Start the app in dev mode for running from source.
--watch
Start the app in watch mode.
--splice-source
Splice source packages into app directory.
--expose-app-in-browser
Expose the global app instance to browser via window.jupyterlab.
--extensions-in-dev-mode
Load prebuilt extensions in dev-mode.
--collaborative
Whether to enable collaborative mode.
--log-level= (Application.log_level)
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--config= (JupyterApp.config_file)
Default: ''
Full path of a config file.
--ip= (ServerApp.ip)
Default: 'localhost'
The IP address the Jupyter server will listen on.
--port= (ServerApp.port)
Default: 8888
The port the Jupyter server will listen on.
--port-retries= (ServerApp.port_retries)
Default: 50
The number of additional ports to try if the specified port is not
available.
--transport= (KernelManager.transport)
Default: 'tcp'
Choices: ['tcp', 'ipc']
--keyfile= (ServerApp.keyfile)
Default: ''
The full path to a private key file for usage with SSL/TLS.
--certfile= (ServerApp.certfile)
Default: ''
The full path to an SSL/TLS certificate file.
--client-ca= (ServerApp.client_ca)
Default: ''
The full path to a certificate authority certificate for SSL/TLS client
authentication.
--notebook-dir= (ServerApp.root_dir)
Default: ''
The directory to use for notebooks and kernels.
--browser= (ServerApp.browser)
Default: ''
Specify what command to use to invoke a web browser when starting the
server. If not specified, the default browser will be determined by the
webbrowser standard library module, which allows setting of the BROWSER
environment variable to override it.
--pylab= (ServerApp.pylab)
Default: 'disabled'
DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
--gateway-url= (GatewayClient.url)
Default: None
The url of the Kernel or Enterprise Gateway server where kernel
specifications are defined and kernel management takes place. If defined,
this Notebook server acts as a proxy for all kernel management and kernel
specification retrieval. (JUPYTER_GATEWAY_URL env var)

To see all available configurables, use --help-all

Examples

jupyter server                       # start the server
jupyter server  --certfile=mycert.pem # use SSL/TLS certificate
jupyter server password              # enter a password to protect the server

[C 2021-11-18 19:42:00.080 ServerApp] Bad config encountered during initialization:
[C 2021-11-18 19:42:00.080 ServerApp] Invalid argument: '--JupyterApp.config_file_name'

@krassowski
Copy link
Member

Sorry, that's my mistake, there should be an equal sign between --JupyterApp.config_file_name and '', like so:

/Users/max/opt/anaconda3/envs/mobile_net_ssd2/bin/python -m jupyterlab --no-browser --JupyterApp.config_file_name=''

@Kaisershmarren
Copy link

Ok. Perfect. Here's the output.

(mobile_net_ssd2) max@MacBook-Pro-di-Massimiliano jupyterlab-desktop % /Users/max/opt/anaconda3/envs/mobile_net_ssd2/bin/python -m jupyterlab --no-browser --JupyterApp.config_file_name=''

[I 2021-11-18 20:18:27.422 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-11-18 20:18:27.707 ServerApp] nbclassic | extension was successfully linked.
[I 2021-11-18 20:18:27.779 LabApp] JupyterLab extension loaded from /Users/max/opt/anaconda3/envs/mobile_net_ssd2/lib/python3.6/site-packages/jupyterlab
[I 2021-11-18 20:18:27.779 LabApp] JupyterLab application directory is /Users/max/opt/anaconda3/envs/mobile_net_ssd2/share/jupyter/lab
[I 2021-11-18 20:18:27.783 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-11-18 20:18:27.788 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-11-18 20:18:27.788 ServerApp] Serving notebooks from local directory: /Users/max/Library/Application Support/jupyterlab-desktop
[I 2021-11-18 20:18:27.788 ServerApp] Jupyter Server 1.4.1 is running at:
[I 2021-11-18 20:18:27.788 ServerApp] http://localhost:8888/lab?token=xxxxxx
[I 2021-11-18 20:18:27.788 ServerApp] or http://127.0.0.1:8888/lab?token=xxxxxxx
[I 2021-11-18 20:18:27.789 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-11-18 20:18:27.794 ServerApp]

To access the server, open this file in a browser:
    file:///Users/max/Library/Jupyter/runtime/jpserver-2280-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/lab?token=xxxxxx
 or http://127.0.0.1:8888/lab?token=xxxxxx

@Kaisershmarren
Copy link

You're right. The version of traitlets is 4.3.3

(mobile_net_ssd2) max@MacBook-Pro-di-Massimiliano ~ % pip show traitlets
Name: traitlets
Version: 4.3.3
Summary: Traitlets Python config system
Home-page: http://ipython.org
Author: IPython Development Team
Author-email: [email protected]
License: BSD
Location: /Users/max/opt/anaconda3/envs/mobile_net_ssd2/lib/python3.6/site-packages
Requires: ipython-genutils, decorator, six
Required-by: qtconsole, notebook, nbformat, nbconvert, nbclient, jupyter-server, jupyter-core, jupyter-client, ipywidgets, ipython, ipykernel
(mobile_net_ssd2) max@MacBook-Pro-di-Massimiliano ~ % pip show jupyterlab
Name: jupyterlab
Version: 3.2.1
Summary: JupyterLab computational environment
Home-page: https://jupyter.org
Author: Jupyter Development Team
Author-email: [email protected]
License: UNKNOWN
Location: /Users/max/opt/anaconda3/envs/mobile_net_ssd2/lib/python3.6/site-packages
Requires: jupyter-core, jinja2, nbclassic, ipython, tornado, packaging, jupyter-server, jupyterlab-server
Required-by:
(mobile_net_ssd2) max@MacBook-Pro-di-Massimiliano ~ %

But...
I cannot upgrade...

(mobile_net_ssd2) max@MacBook-Pro-di-Massimiliano ~ % pip install --upgrade traitlets==5.0.0
ERROR: Could not find a version that satisfies the requirement traitlets==5.0.0 (from versions: 0.0.1, 0.0.2, 4.0.0.dev0, 4.0.0, 4.1.0b1, 4.1.0, 4.2.0, 4.2.1, 4.2.2, 4.3.0b1, 4.3.0, 4.3.1, 4.3.2, 4.3.3.dev0, 4.3.3)
ERROR: No matching distribution found for traitlets==5.0.0

@krassowski
Copy link
Member

This is interesting. Newer versions are certainly available on PyPI: https://pypi.org/project/traitlets/

Maybe you have a version of Python which is no longer supported by trailers in 5.x? Or, less likely maybe you use a PyPI mirror which was not updated?

@Kaisershmarren
Copy link

In mobile_net_ssd2 I've python version 3.6.13.

and it seems that traitlets 5.0.0 support only python >= 3.7

https://githubmemory.com/repo/ipython/traitlets/issues/628

@chipmuenk
Copy link

I tried to install the app just for me under Win 10 64b (still I have to elevate the access rights). Then I run into the problem of a greyed out "install" button during selection of the install location:

jlab_install_1

I cancelled installation at that point and restarted which skipped the first part of installation and gave me the message:

jlab_install_2

I tried to select the bundled Python environment and got the same pop-up window once more.

On my system I have

c:\Users\Chris.pyenv\pyenv-win\shims\python
c:\Users\Chris.pyenv\pyenv-win\shims\python.bat
C:\Users\Chris\AppData\Local\Microsoft\WindowsApps\python.exe

For some reason, I cannot select the Windows Python.exe, when selecting the first entry I get the following error:

jlab_install_3

And here is the log file:

main.log

@krassowski
Copy link
Member

@chipmuenk You need to install jupyterlab in the selected environment (pyenv-win) and it should work. You could do so by running:

pyenv activate pyenv-win
pip install -U "jupyterlab>=3.1"

The issue with greyed out "Next" button is interesting. Could it be that you have less space available than required by installer?

@chipmuenk
Copy link

I'm sorry but then I don't see the point of the Jupyterlab Desktop App. I thought it was targeted at newbies as a simple one-file-click-to-install solution? I have always done a simple pip install jupyterlab in my selected Python environment and was ready to go - what do I need the Desktop App for?

On my c:\ drive I have 72 GB free space which should be enough.

@krassowski
Copy link
Member

I thought it was targeted at newbies as a simple one-file-click-to-install solution?

Yes, the idea is to work like that. For some reason your installation failed. When you attempted to recover the installation by running the installer once again, it must have skipped the installation of the ready-to-go virtual environment targeted at newbies. Knowing that you are an advanced user (based on your previous comments) and seeing that you are able to recover by selecting a different virtual environment I suggested to run pip install in a way which should ensure that the required version is installed. It is not a prerequisite of using JupyterLab Desktop when the installation process works as it should.

If you believe that you already have correct version of jupyterlab installed in that environment please provide pip list output so we can see what version that is and can start thinking how to solve this problem.

PS. I would appreciate more understanding tone. There is no need for rhetorical questions.

@chipmuenk
Copy link

I'm sorry if I came across unfriendly but my question was meant seriously. For me, the installation experience has been quite confusing so far and it sounded to me as if previous installation of the jupyterlab package was a requirement, especially as I had problems with the jupyter server every time.

I'm afraid I can't give you a pip list, the path I've selected during installation was c:\Users\Chris.pyenv\pyenv-win\shims\python which probably doesn't point to a python installation at all without activating an environment beforehand.

@krassowski
Copy link
Member

I'm afraid I can't give you a pip list, the path I've selected during installation was c:\Users\Chris.pyenv\pyenv-win\shims\python which probably doesn't point to a python installation at all without activating an environment beforehand.

Sorry, I do not follow. Do you mean that you pointed the first of the two Windows installers to use C:\Users\Chris\pyenv\pyenv-win\shims\python and then did not adjust the path for the second one? That could explain why the Next button was greyed out - the default path may have not existed. We recommend keeping the instillation path unchanged if possible in the installation instructions: https://github.com/jupyterlab/jupyterlab-desktop/blob/master/user-guide.md#windows-instructions

Or, do you mean that after starting the application which showed you the "Set Python Environment" window you pointed it to C:\Users\Chris\pyenv\pyenv-win\shims\python as the screenshots that you provided suggest? Sorry but I cannot get a coherent picture of what exactly you done and why that path would not contain a python environment.

@krassowski
Copy link
Member

krassowski commented Nov 27, 2021

Hi @Kaisershmarren, @flashypepo, @alejandroschuler, @pybokeh the newly released v3.2.4-2 contains two fixes for this problem - would you mind testing it and letting us know if it works for you well now?

If it does not could you please provide the logs from:

  • on Linux: ~/.config/jupyterlab-desktop/logs/main.log
  • on macOS: ~/Library/Logs/jupyterlab-desktop/main.log
  • on Windows: %USERPROFILE%\AppData\Roaming\jupyterlab-desktop\logs\main.log

@Kaisershmarren
Copy link

Great work, @krassowski!!!
It perfectly works, now.
Immagine 27-11-21 alle 15 18

Thank you so much.

@flavio87
Copy link

flavio87 commented Dec 2, 2021

This is still broken for me on macOS 11.6.1 (Big Sur), even with the latest version
Error: Jupyter Server process terminated before the initialization completed

main.log output

[2021-12-02 02:43:23.086] [warn]  Error: Jupyter Server process terminated before the initialization completed
     at ChildProcess.<anonymous> (/Users/flavio/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/server.js:91:28)
     at ChildProcess.emit (events.js:315:20)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

@krassowski
Copy link
Member

@flavio87 could you please provide earlier logs from main.log, or is it everything that is in there? I believe there should be more including lines containing Jupyter Server initialization message. If not, could you please try to start the process with jlab --verbose 4 and check again?

@flavio87
Copy link

flavio87 commented Dec 2, 2021

ah yes, here is the previous message. I don't know why it is already executing some code (and then failing at loading a particular file) when I am just opening the app?

 [2021-12-02 02:43:11.258] [info]  Logging to file (/Users/flavio/Library/Logs/jupyterlab-desktop/main.log) at 'false' level
 [2021-12-02 02:43:11.386] [error] (node:17855) DeprecationWarning: findLogPath() is deprecated and will be removed in v5.
 (Use `JupyterLab --trace-deprecation ...` to show where the warning was created)
 [2021-12-02 02:43:23.068] [info]  Jupyter Server initialization message: Traceback (most recent call last):
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/runpy.py", line 185, in _run_module_as_main
     mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/runpy.py", line 144, in _get_module_details
     return _get_module_details(pkg_main_name, error)
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/runpy.py", line 111, in _get_module_details
     __import__(pkg_name)
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/jupyterlab/__init__.py", line 7, in <module>
     from .labapp import LabApp
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/jupyterlab/labapp.py", line 13, in <module>
     from jupyter_core.application import JupyterApp, NoStart, base_aliases, base_flags
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/jupyter_core/application.py", line 22, in <module>
     from .paths import (
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/jupyter_core/paths.py", line 16, in <module>
     import tempfile
   File "/Users/flavio/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/tempfile.py", line 45, in <module>
     from random import Random as _Random
   File "/Users/flavio/random.py", line 45, in <module>
     print(find_all_barcodes(experiment_ids))
   File "/Users/flavio/random.py", line 39, in find_all_barcodes
     barcodes.append(find_barcodes(file_name))
   File "/Users/flavio/random.py", line 25, in find_barcodes
     with open(sam_file, 'r') as f:
 FileNotFoundError: [Errno 2] No such file or directory: 'fasta/mysamfile.sam'

 [2021-12-02 02:43:23.086] [warn]  Error: Jupyter Server process terminated before the initialization completed
     at ChildProcess.<anonymous> (/Users/flavio/Applications/JupyterLab.app/Contents/Resources/app.asar/build/out/main/server.js:91:28)
     at ChildProcess.emit (events.js:315:20)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)```

@krassowski
Copy link
Member

krassowski commented Dec 2, 2021

@flavio87 thank you. It looks like you have a file which shadows the Python built-in random library. When Jupyter attempts to initialize the server, instead of getting the Python built-in random it gets your /Users/flavio/random.py. This is a common occurrence in Python, see: https://stackoverflow.com/questions/25695412/module-object-has-no-attribute-choice-trying-to-use-random-choice

Do you happen to have PYTHONPATH, or PYTHONHOME set?

Maybe we should start Python in -E mode...

@flavio87
Copy link

flavio87 commented Dec 2, 2021

omg, I had created a file called random.py to play around with some code, and that is what it was importing. I just had to rename this file to random2.py and now it works again...

I don't think any of the PYTHONPATH, or PYTHONHOME are set (at least nothing shows when I call echo $PYTHONPATH or the other.)

@doctor-duus
Copy link

doctor-duus commented Dec 17, 2021

Hello. I have a related problem to this one (I think?)

I am on the MacOS, and I would like to access the jlab executable like this webpage describes:

JupyterLab Desktop can be launched [...] by using jlab command from the command line

But when I try to run it, it's not there:

 bin> ls /usr/local/bin/jlab
 /usr/local/bin/jlab
 bin> jlab
 -bash: /usr/local/bin/jlab: No such file or directory
 bin> file jlab
 jlab: broken symbolic link to /Applications/JupyterLab.app/Contents/Resources/app/jlab

But there is no app subfolder, there's onlyt his app.asar file:

 bin> ls /Applications/JupyterLab.app/Contents/Resources/app*
 /Applications/JupyterLab.app/Contents/Resources/app.asar

Any ideas? Thanks!

jupyter --version
Selected Jupyter core packages...
IPython : 7.27.0
ipykernel : 6.4.1
ipywidgets : not installed
jupyter_client : 7.0.3
jupyter_core : 4.8.1
jupyter_server : not installed
jupyterlab : not installed
nbclient : not installed
nbconvert : not installed
nbformat : 5.1.3
notebook : not installed
qtconsole : not installed
traitlets : 5.1.0

macos: 10.14.6

@krassowski
Copy link
Member

@doctor-duus I believe this is unrelated. We would need more information. Could you please open a new bug report providing all the details requested in the template?

@doctor-duus
Copy link

Hello. It turns out I apparently did not fully follow the uninstall instructions. When I redid (or correctly did?) the uninstall instructions and reinstalled, it worked fine.

@Okaforemeka
Copy link

Hi @krassowski could you kindly guide me on how to resolve this issue, I still get the error message below. I also attached my windows log below for your support.
image
Thanks alot in advance
main.log
.

@krassowski
Copy link
Member

@Okaforemeka it looks like you are experiencing the _ssl issue which is specific to some Windows installations - please see #381; would you mind trying the workaround mentioned in #381 (comment) and letting us know if it helped (here or in the other thread), please?

@Okaforemeka
Copy link

@krassowski Many thanks for your specific guidance, it resolves my issue and i'm now able to reuse Jupyter lab. This was very helpful.

Thanks. Wish you a great year.

@meeseeksmachine
Copy link

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/how-to-solve-jupyter-server-initialization-failed/12469/2

@alejandroschuler
Copy link
Author

Just checked and everything works for me with the latest version (with my own environment, following the instructions on the user guide). Not sure what the problem was but it's all good now. I'm going to close the issue since there are other more specific issues that seem to apply for other problems but feel free to reopen if this is a good general-purpose forum.

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