libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.81k stars 180 forks source link

Installation via pip? #168

Closed markmno closed 2 years ago

markmno commented 2 years ago

Could you please provide pip installation guide?

GuillaumeLeclerc commented 2 years ago

pip can only install python packages. However FFCV depends on C++ libraries. Therefore it impossible to install FFCV just using pip. You can however install the required libraries with your operating system. We require libturbojpeg and opencv C++ libraries and their corresponding headers. We won't give a guide for that since instructions to install those depend on the operating system you use.

kiedanski commented 2 years ago

I managed to get it working (pip install ffcv numba opencv-python) by installing libturbojpeg-dev and libopencv-dev inside docker (I'm using nvidia/cuda:11.2.1-base-ubuntu20.04)

lucasresck commented 11 months ago

In my case (Ubuntu 22.04, Python 3.11 virtual environment), I had to:

sudo apt install libopencv-dev
sudo apt install libturbojpeg-dev
sudo apt-get update
sudo apt-get install --reinstall build-essential
sudo apt-get install python3.11-dev
pip install ffcv

The build-essential reinstall was because I faced some type of gcc error:

      x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory

And the python3.11-dev install was because I faced a Python error:

      ./libffcv/libffcv.cpp:2:10: fatal error: Python.h: No such file or directory