So I want to use python-occ
library. It requires conda-forge
to be build. I try to install it in basic notebook
!wget -c https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
!chmod +x Anaconda3-5.1.0-Linux-x86_64.sh
!bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -f -p=conda3
!export PYTHONPATH=./conda3/lib/python
!export PATH=./conda3/bin/:$PATH
!conda install -y -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core
Yet it will install a package into condas python. How to make oit install package into global python or use its python\libs folder for cels interpritation?
So what one must do to build/install stuff with conda
in colab
?
Unfortunately, Conda is not available by default on Google Colab and getting Conda installed and working properly within Google Colab's default Python environment is a bit of a chore.
To install conda, a library has been created specifically for Google Colab, conda-colab, and fortunately for us it is very easy to use ! You just have to install it with the pip command, then install conda with the condacolab. install() function. The code should return something like : conda 4.9.
We often use Google Colab because of the several benefits like pre-installed libraries, saved on the cloud, collaboration and free GPU and TPU, etc. Sometimes we need anaconda environment for our project. Today we will see how to set up anaconda environment in Google Colab.
To import a library that's not in Colaboratory by default, you can use !pip install or ! apt-get install .
The following seems to work:
!wget -c https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
!chmod +x Anaconda3-5.1.0-Linux-x86_64.sh
!bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -f -p /usr/local
!conda install -y --prefix /usr/local -c <<<your wish>>>>
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages/')
I once needed a library that was available only through Conda too. My solution is that
!pip install
all the requirements of that libraryAnd it worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With