ReproNim / neurodocker

Generate custom Docker and Singularity images, and minimize existing containers
https://www.repronim.org/neurodocker/
Apache License 2.0
329 stars 97 forks source link

Errors while pip installing many packages: permission denied #355

Closed jsmentch closed 4 years ago

jsmentch commented 4 years ago

I'm trying to make a singularity image with pliers and its optional dependencies but keep getting errors like:

ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/__db.001'
You need to be root to perform this command.
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************

----------------------------------------
ERROR: Failed building wheel for dlib
ERROR: Command errored out with exit status 1:

I've tried changing the neurodocker command around and installing cmake and using debian instead of centos 7 but not having any luck. Does anyone know what might be happening here? Thanks!

Link to the log on singularity-hub

and the command I was using to run neurodocker:

singularity run neurodocker.simg generate singularity \
  --base centos:7 --pkg-manager yum \
  --user neuro \
  --install emacs cmake \
  --miniconda use_env=base \
      pip_install="pliers clarifai duecredit face_recognition python-twitter gensim google-api-python-client google-compute-engine librosa>=0.6.3 matplotlib opencv-python pathos pygraphviz pysrt pytesseract python-twitter scikit-learn seaborn soundfile spacy SpeechRecognition>=3.6.0 tensorflow>=1.0.0 torch transformers xlrd rev_ai" \
  --user root > Singularity
stebo85 commented 4 years ago

Hi @jsmentch,

Could it be that you change to user neuro before you install things? Would this work better for you?

singularity run neurodocker.simg generate singularity \ --base centos:7 --pkg-manager yum \ --install emacs cmake \ --miniconda use_env=base \ pip_install="pliers clarifai duecredit face_recognition python-twitter gensim google-api-python-client google-compute-engine librosa>=0.6.3 matplotlib opencv-python pathos pygraphviz pysrt pytesseract python-twitter scikit-learn seaborn soundfile spacy SpeechRecognition>=3.6.0 tensorflow>=1.0.0 torch transformers xlrd rev_ai" \ --user neuro> Singularity

jsmentch commented 4 years ago

Thanks for your response! I just gave that a try and still hitting those same errors, unfortunately

kaczmarj commented 4 years ago

@jsmentch - pip will install packages from source (if a pre-compiled wheel file isn't available), and it looks like pip is invoking cmake to compile dlib. cmake is not installed in the image, which is causing that error. I realize you installed cmake and still faced an issue, so I'm not sure, but some system dependencies are probably missing.

instead of trying to go down that rabbit hole of debugging dependencies, i suggest you use conda to install most of the packages. conda will install pre-built packages, so no compilation is necessary. Can you try installing most of the packages from conda? pliers doesn't seem to be available on conda, so that can be pip installed, but any dependencies that require compilation should be conda installed.

jsmentch commented 4 years ago

Ok, thanks for this info! I will give that a try.

kaczmarj commented 4 years ago

any updates @jsmentch ?

jsmentch commented 4 years ago

I ended up not needing some of those dependencies and in general now favoring conda over pip as recommended has helped a lot - thanks! Will close this