2

I have tried installing conda and then Bob in Google colab but it still fails to import Bob. Here is a notebook that demonstrates the issue: https://colab.research.google.com/drive/1ns_pjEN0fFY5dNAO0FNLAG422APFu-NI

The steps are:

%%bash
# based on https://towardsdatascience.com/conda-google-colab-75f7c867a522
MINICONDA_INSTALLER_SCRIPT=Miniconda3-4.5.4-Linux-x86_64.sh
MINICONDA_PREFIX=/usr/local
wget https://repo.continuum.io/miniconda/$MINICONDA_INSTALLER_SCRIPT
chmod +x $MINICONDA_INSTALLER_SCRIPT
./$MINICONDA_INSTALLER_SCRIPT -b -f -p $MINICONDA_PREFIX
!conda install --channel defaults conda python=3.6 --yes --quiet
!conda install --yes --quiet --override-channels \
  -c https://www.idiap.ch/software/bob/conda -c defaults \
  python=3.6 bob.io.image bob.bio.face # add more Bob packages here as needed
import sys
sys.path.append("/usr/lib/python3.6/site-packages")
import pkg_resources
import bob.extension, bob.io.base, bob.io.image

which produces:

ModuleNotFoundError                       Traceback (most recent call last)

<ipython-input-5-8e8041c9e60e> in <module>()
      1 import pkg_resources
----> 2 import bob.extension, bob.io.base, bob.io.image

ModuleNotFoundError: No module named 'bob'
183.amir
  • 422
  • 3
  • 25
m.m
  • 51
  • 1
  • 6
  • Please share a self-contained notebook that reproduces the problem you observe. As written presently, there's not enough information to diagnose the issue. – Bob Smith Jun 28 '20 at 15:45
  • I did the installation of bob in my environment which I already created ( !source activate bob_env1 !conda install bob.core ) the installation is done successfully but when I import bob.core or an other sub-package ( !source activate bob_env1 import bob.core) an error indicates that " No module named 'bob'" – m.m Jun 28 '20 at 16:39
  • Dear Rania, please share a notebook with us that demonstrates your problem. – 183.amir Jun 29 '20 at 08:47
  • @183.amir Thankyou for your reply, the error has changed but it remains in the same context ` !source activate bob_env1 !conda install bob ` the installation is done successfully but when i do ` !source activate bob_env1 import bob import bob.core ` this error is displayed ` --------------------------------------------------------------------------- DistributionNotFound Traceback (most recent call last) in () 1 get_ipython().system('source activate bob_env1') 2 import bob ----> 3 import bob.core – m.m Jun 29 '20 at 09:50
  • @183.amir 4 import bob.io.base 5 import bob.learn.em 3 frames /usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py in resolve (self, requirements, env, installer, replace_conflicting, extras) 784 if dist is None: 785 requirers = required_by.get (req, None) -> 786 raise DistributionNotFound (req, requirers) 787 to_activate.append (dist) 788 if dist not in req: DistributionNotFound: The 'bob.extension' distribution was not found and is required by the application `I hope you understand me – m.m Jun 29 '20 at 09:51
  • Here is a link to google colab where I tried to install Conda first and then Bob but for some reason I cannot make it work: https://colab.research.google.com/drive/1ns_pjEN0fFY5dNAO0FNLAG422APFu-NI?usp=sharing Maybe @BobSmith can help? – 183.amir Jun 29 '20 at 12:03
  • still in the same problem – m.m Jun 29 '20 at 12:47

0 Answers0