facebookresearch / facebookresearch/fairseq2

OSError: fairseq2 requires libsndfile. Since you are in a Conda environment, use `conda install -c conda-forge libsndfile==1.0.31` to install it.

Open
#1,079 2 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Python
Stars
1.1k
Forks
144
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Hi, I have an error when try to run tutorial of [end_to_end_fine_tuning](https://facebookresearch.github.io/fairseq2/stable/tutorials/end_to_end_fine_tuning.html).

The commend I am running:

```
fairseq2 lm instruction_finetune $OUTPUT_DIR --config-file configs/sft.yaml
```

The error message is below:

```
Traceback (most recent call last):
File "/home/yu/projects/RLHF/rlhf/bin/fairseq2", line 5, in
from fairseq2.cli import main
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2/__init__.py", line 11, in
import fairseq2n # Report any fairseq2n initialization error eagerly.
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 169, in
_load_shared_libraries()
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 88, in _load_shared_libraries
_load_sndfile()
File "/home/yu/projects/RLHF/rlhf/lib/python3.10/site-packages/fairseq2n/__init__.py", line 115, in _load_sndfile
raise OSError(
OSError: fairseq2 requires libsndfile. Since you are in a Conda environment, use `conda install -c conda-forge libsndfile==1.0.31` to install it.
```

I installed the [libsndfile](https://github.com/libsndfile/libsndfile) through:

```
sudo apt install libsndfile1
```

And installed the pytorch and fairseq2 in a venv environment through:

```
pip3 install torch torchvision torchaudio
pip install fairseq2\
--extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/pt2.6.0/cu124
```

Following issue #10, I disabled conda by comment out related code in ~/.bashrc:
```
## >>> conda initialize >>>
## !! Contents within this block are managed by 'conda init' !!
#__conda_setup="$('/home/yu/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
# eval "$__conda_setup"
#else
# if [ -f "/home/yu/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/home/yu/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/home/yu/anaconda3/bin:$PATH"
# fi
#fi
#unset __conda_setup
## <<< conda initialize <<<
```
But it does not work for me, and I still face this error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.