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

Installation failure on fresh Ubuntu 18.04 #526

Closed
drjarno opened this issue Mar 5, 2020 · 3 comments
Closed

Installation failure on fresh Ubuntu 18.04 #526

drjarno opened this issue Mar 5, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@drjarno
Copy link

drjarno commented Mar 5, 2020

I created a fresh VM with 18.04 and ran apt full-upgrade to install the latest updates.

Then I tried to install Jupyter Hub by following the installation instructions:
sudo apt install python3 python3-dev git curl

curl https://raw.githubusercontent.com/jupyterhub/the-littlest- 
jupyterhub/master/bootstrap/bootstrap.py | sudo -E python3 - --admin jarno

Unfortunately, this failed with the following error:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6354  100  6354    0     0  38277      0 --:--:-- --:--:-- --:--:-- 38277
Checking if TLJH is already installed...
Setting up hub environment
Installed python & virtual environment
Set up hub virtual environment
Setting up TLJH installer...
Setup tljh package
Starting TLJH installer...
Setting up admin users
Granting passwordless sudo to JupyterHub admins...
Setting up user environment...
Downloading & setting up user environment...
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 508, in <module>
    main()
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 491, in main
    ensure_user_environment(args.user_requirements_txt_url)
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 272, in 
ensure_user_environment
    'conda==' + conda_version
  File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/conda.py", line 109, in 
ensure_conda_packages
    ] + packages).decode()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/opt/tljh/user/bin/python', '-m', 'conda', 'install', '-c', 
'conda-forge', '--json', '--prefix', '/opt/tljh/user', 'conda==4.8.1']' returned non-zero exit status 1.

I noticed that conda was only at version 4.7.10, so I updated with

sudo -E /opt/tljh/user/bin/python -m conda update --all

After that, I ran the install command again and this time it worked. I hope this workaround will help you to figure out why the install scripts fails on a fresh Ubuntu 18.04 VM.

@nmvega
Copy link

nmvega commented Apr 22, 2020

@drjarno I had the same issue, but the cause was different. When you happen to install conda (in my case Miniconda3, it interferes with the TLJH installer. That's because, although parts of the installer does indeed use it's internal virtual environment python -- i.e. /opt/tljh/user/bin/python -- as that installer downloads additional components to installs them, if it happens to find your external conda (i.e. find it first in the PATH), then it will cause conflict and crash exactly as above.

I ended up removing conda completely (100%) and am using straight python to intall TLJH until I can figure out how to get the TLJH installer to reliably work with conda installed side-by-side.

P.S. I tried @drjarno update solution, but the failure remained because it kept finding my conda's python.

EDIT (UPDATE):
I figured out how to overcome my variety of this issue.

I always install conda in /opt/conda.d/. To avoid my version of this problem, I dynamically (temporarily) remove /opt/conda.d/bin/ from my PATH environment variable, like this:

root# export PATH='.:/root/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:'

Then I immediately run the installer using /opt/conda.d/bin/python3 (yes, the one I just removed from the PATH), like this:

root# /opt/conda.d/bin/python3 /root/tinstall.tljh.py

Now, however, since /opt/conda.d/bin/{conda, python3} aren't in my PATH environment variable, other TLJH components downloaded later on won't find them; and avoids the conflict.

And finally, once installation is complete, I recover the PATH by simply re-sourcing .profile:

root# . /root/.profile

I hope this helps, too.

@ltoop
Copy link

ltoop commented May 7, 2020

I had the error when installing on a Multipass default instance of Ubuntu LTS, with only 1GB memory. Running the command showed an error because that was not enough memory. Failed when 2GB available as well - worked at 4GB.

@consideRatio
Copy link
Member

With #697, we have a very up to date version of conda/mamba so the workaround won't be needed. The mamba CLI is a high performance clone of the conda CLI.

@consideRatio consideRatio added the bug Something isn't working label Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants