Skip to content

Instantly share code, notes, and snippets.

@korakot
Last active April 20, 2023 21:47
Show Gist options
  • Save korakot/d0a49d7280bd3fb856ae6517bfe8da7a to your computer and use it in GitHub Desktop.
Save korakot/d0a49d7280bd3fb856ae6517bfe8da7a to your computer and use it in GitHub Desktop.
Install faiss on Google Colab without using Conda
# CPU
!curl -L https://anaconda.org/pytorch/faiss-cpu/1.6.0/download/linux-64/faiss-cpu-1.6.0-py36h6bb024c_0.tar.bz2 | tar xj
# GPU, CUDA 10
# !curl -L https://anaconda.org/pytorch/faiss-gpu/1.6.0/download/linux-64/faiss-gpu-1.6.0-py36h1a5d453_0.tar.bz2 | tar xj
# install
!mv lib/python3.6/site-packages/* /usr/local/lib/python3.6/dist-packages/
import faiss
# For CPU
!apt install libomp-dev
!pip install faiss
# For GPU
!pip install faiss-gpu
@korakot
Copy link
Author

korakot commented Oct 27, 2018

# get package then extract
!wget https://anaconda.org/conda-forge/cartopy/0.16.0/download/linux-64/cartopy-0.16.0-py36h81b52dc_2.tar.bz2
!tar xvjf cartopy-0.16.0-py36h81b52dc_2.tar.bz2
!cp -r lib/python3.6/site-packages/* /usr/local/lib/python3.6/dist-packages/
# install dependencies
!pip install shapely pyshp
!apt install libproj-dev libgeos-dev
# finally
import cartopy

@korakot
Copy link
Author

korakot commented Nov 14, 2018

# pygraphviz
!wget https://anaconda.org/anaconda/pygraphviz/1.3/download/linux-64/pygraphviz-1.3-py36h14c3975_1.tar.bz2
!tar xvjf pygraphviz-1.3-py36h14c3975_1.tar.bz2
!cp -r lib/python3.6/site-packages/* /usr/local/lib/python3.6/dist-packages/

import pygraphviz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment