Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing: salesforce-lavis 1.0.2 depends on decord #231

Open
shakedzy opened this issue Apr 3, 2023 · 9 comments
Open

Error installing: salesforce-lavis 1.0.2 depends on decord #231

shakedzy opened this issue Apr 3, 2023 · 9 comments

Comments

@shakedzy
Copy link

shakedzy commented Apr 3, 2023

I'm trying to pip install lavis, but keeps getting this:

ERROR: Cannot install salesforce-lavis==1.0.0 and salesforce-lavis==1.0.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    salesforce-lavis 1.0.2 depends on decord
    salesforce-lavis 1.0.0 depends on decord

When trying to run pip install decord I get:

ERROR: Could not find a version that satisfies the requirement decord (from versions: none)
ERROR: No matching distribution found for decord

I tried this on new virtual-envs using Python 3.11, 3.10 and 3.8 on an M1 mac.

@nomorewzx
Copy link

Hi, @shakedzy I met the same error onM1 Macbook with Python 3.18.16.

I did some search and found that it's because the decord does not support M1 chip. See here: dmlc/decord#225

I am afraid it just does not work to install lavis on M1 chip Macbook

@karvinok
Copy link

karvinok commented Apr 7, 2023

same here. it depends on decord and not possible to install

@shakedzy
Copy link
Author

shakedzy commented Apr 8, 2023

Seems like the open issue on decord is from 08/2022, so I guess this isn't getting fixed any time soon..

@Andrew-Chen-Wang
Copy link

I'm on Intel, not M1, but it's possible you could try to install from source?

brew install ffmpeg cmake
git clone --recursive https://github.com/dmlc/decord
cd decord
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
cd ../python
python setup.py install

You may need to change some source code as shown here: dmlc/decord#186 (comment)

@ab3llini
Copy link

Hello, for anyone landing here, this is how i temporarily fixed this annoying issue.

I am using python 3.10 on Intel macOS, but it looks like there are no wheels for decord for my python version (up to 3.8).
So, I downloaded the wheel manually (Wheels), I used decord-0.6.0-cp38-cp38-macosx_10_15_x86_64.whl

Then, I tried to pip install decord-0.6.0-cp38-cp38-macosx_10_15_x86_64.whl, but it yielded errors because cp38 means I should have python3.8.

I changed the filename to decord-0.6.0-cp310-cp310-macosx_10_15_x86_64.whl and ran pip install decord-0.6.0-cp310-cp310-macosx_10_15_x86_64.whl, package installed successfully.

Afterwards I ran python3 -m pip install salesforce-lavis and finally I managed to install it.

Note: I tried to install decord from source: no success.

@Andrew-Chen-Wang
Copy link

If you install from source, you need to change the source code itself because you likely have an incompatible ffmpeg (v5 instead of v4).

@devfacet
Copy link

devfacet commented May 15, 2023

For Apple Silicon try (https://github.com/georgia-tech-db/eva-decord):

diff --git a/requirements.txt b/requirements.txt
index 247190d..05a3e7d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 contexttimer
-decord
+eva-decord
 einops>=0.4.1
 fairscale==0.4.4
 ftfy

and build with pip install -e .

@redrockzee
Copy link

redrockzee commented May 30, 2023

I was able to run the Zoo on ARM 64 Ubuntu Linux / Python 3.9 after doing the following steps. I have not tried anything else yet.

  1. Use @devfacet's suggestion with a few modifications of the eva-decord instructions.
  • Make sure to clone the repository recursively -- not zip download. There are dependencies on other Git projects.
  • Follow the instructions to build.
  • Copy the libdecord.so into the decord/python directory.
  • Modify python/setup.py replacing 'libdecord.dylib' with 'libdecord.so'
  • python3.9 setup.py install --user

Example code:

apt-get update
apt-get install -y build-essential python3-dev python3-setuptools make cmake
apt-get install -y ffmpeg libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev
git clone --recursive https://github.com/georgia-tech-db/eva-decord.git
mkdir eva-decord/build & cd eva-decord/build
cmake .. -DUSE_CUDA=0 -DCMAKE_BUILD_TYPE=Release
make
cp libdecord.so ../python
cd ../python & sed -i 's/dylib/so/g' setup.py
python3.9 setup.py install --user
  1. Copy requirements.txt from the Lavis repository tagged 1.0.2 and add the following lines after removing decord.
langcodes
pathy
smart-open
spacy-legacy
spacy-loggers
typer==0.7.*
thinc
huggingface_hub
braceexpand
portalocker
antlr4-python3-runtime==4.9.*
eva-decord
  1. Install Lavis using modified requirements
    python3.9 -m pip install salesforce-lavis==1.0.2 --no-deps -r lavisRequirements.txt

lavisRequirements.txt

@udion
Copy link

udion commented May 8, 2024

For Apple Silicon try (https://github.com/georgia-tech-db/eva-decord):

diff --git a/requirements.txt b/requirements.txt
index 247190d..05a3e7d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 contexttimer
-decord
+eva-decord
 einops>=0.4.1
 fairscale==0.4.4
 ftfy

and build with pip install -e .

I had to make a small change above because it was still breaking on my M1 with Python3.10 because of the version specified for open3d in requirements (open3d==0.13.0). I simply removed the version from it

diff --git a/requirements.txt b/requirements.txt
index 247190d..05a3e7d 100644
--- a/requirements.txt
+++ b/requirements.txt
-open3d==0.13.0
+open3d

and build with pip install -e .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants