By Nick Brady


2019-08-12 21:27:02 8 Comments

I'm trying to create an environment from an existing environment via conda on Ubuntu18. I want to accomplish this by exporting an environment.yml file and then using that to create an another environment from. The problem is it terminates before creating the environment without an error message.

(nenv) nick {~}$ conda env export --name nenv > nenv.yml
(nenv) nick {~}$ sudo su - testusr
[email protected]:~$ conda env create --name myenv --file /home/nick/nenv.yml 
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: / Killed

It keeps crashing on "Verifying transaction" for whatever reason. I have tried this on an environment installed to a public path and another installed to a user directory.

some notes:

  1. This is a multi user anaconda installation on linux

  2. The root conda environment is at /opt/conda/

  3. The user is using the root conda binary in the conda env create

  4. conda 4.7.11

I have been able to create a shared environment between users, but I want to also figure out how I can have copies of the same conda environment for two different users using a requirements file type methodology (for JupyterHub kernels).


After the very helpful comment, I'm seeing there are a lot of permissions errors. I can likely get it from here. Definitely should have thought to look for verbosity flags 😅Will update here if I figure out solution:

... (much more ☝️)
DEBUG conda.gateways.disk.create:create_link(363): PermissionError(1, 'Operation not permitted')
DEBUG conda.gateways.disk.create:create_link(367): hard-link failed. falling back to copy
  error: PermissionError(1, 'Operation not permitted')
  src: /opt/conda/pkgs/seaborn-0.9.0-py37_0/info/index.json
  dst: /home/scientist/.conda/envs/nenv/.tmp.index.json.ce11d637
DEBUG conda.gateways.disk.create:create_link(363): PermissionError(1, 'Operation not permitted')
DEBUG conda.gateways.disk.create:create_link(367): hard-link failed. falling back to copy
  error: PermissionError(1, 'Operation not permitted')
  src: /opt/conda/pkgs/anaconda-2019.03-py37_0/info/index.json
  dst: /home/scientist/.conda/envs/nenv/.tmp.index.json.26122231
DEBUG conda.core.link:_get_python_version(812): found in current transaction python version 3.7.3
done
Verifying transaction: ...working... Killed

1 comments

@Nick Brady 2019-08-12 22:26:22

So, the answer is that it is due to permissions issues with how my anaconda installation is. I installed it to /opt/conda as root initially which makes some features, including environment creation, not work apparently.

Funny enough, I blew away the server and recreated it (it has an ansible playbook to set it up) and the installation (while still being owned by root) did not have the same issue I asked about in this question. Perhaps new versions of conda don't have this issue while creating environments.


Documenting what I've done here as it is progress; however, if someone knows what's wrong from my latest point I will mark it as the correct answer!

Following the guide here: https://support.anaconda.com/hc/en-us/articles/360023865574-Multi-User-Anaconda-Installation-on-Linux

(nenv) nick {~}$ ls -al /opt/
total 12
drwxr-xr-x  3 root root 4096 Jul 14 10:22 .
drwxr-xr-x 23 root root 4096 Aug 12 18:45 ..
drwxr-xr-x 26 root root 4096 Aug 12 22:10 conda
(nenv) nick {~}$ sudo chgrp -R developers /opt/conda/
(nenv) nick {~}$ ls -al /opt/
total 12
drwxr-xr-x  3 root root       4096 Jul 14 10:22 .
drwxr-xr-x 23 root root       4096 Aug 12 18:45 ..
drwxr-xr-x 26 root developers 4096 Aug 12 22:10 conda
(nenv) nick {~}$ sudo chmod 770 -R /opt/conda/
(nenv) nick {~}$ ls -al /opt/
total 12
drwxr-xr-x  3 root root       4096 Jul 14 10:22 .
drwxr-xr-x 23 root root       4096 Aug 12 18:45 ..
drwxrwx--- 26 root developers 4096 Aug 12 22:10 conda

At this point according to the conda docs I should be able to create the environment.. but I can't. The error is now:

DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.42434629
PermissionError(1, 'Operation not permitted')
DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.c45bcb48
PermissionError(1, 'Operation not permitted')
DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.11a11e9d
PermissionError(1, 'Operation not permitted')
DEBUG conda.core.link:_get_python_version(812): found in current transaction python version 3.7.3
done
Verifying transaction: ...working... Killed

Rather confusing since the user is part of the group that owns the entire directory.

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Not able to activate new environment with conda

  • 2018-10-10 18:45:15
  • mdivk
  • 1744 View
  • 2 Score
  • 1 Answer
  • Tags:   conda

1 Answered Questions

1 Answered Questions

How do I create Conda environment in Windows 10

1 Answered Questions

creating conda venv: conda env create VS conda env update

1 Answered Questions

Anaconda : Update conda failed because permission error

1 Answered Questions

Conda Create Env - CondaHTTPError

  • 2016-11-19 01:53:38
  • dt mansfield
  • 3627 View
  • 2 Score
  • 1 Answer
  • Tags:   python conda

Sponsored Content