0

I'm trying to install soundfile in a new conda environment. I've tried everything and I keep getting the ModuleNotFoundError: No module named 'soundfile'.

On the same machine, I have an old conda environment where it works. If I type pip show soundfile I get:

Name: SoundFile
Version: 0.10.3.post1
Summary: An audio library based on libsndfile, CFFI and NumPy
Home-page: https://github.com/bastibe/PySoundFile
Author: Bastian Bechtold
Author-email: basti@bastibe.de
License: BSD 3-Clause License
Location: /usr/local/lib/python3.6/dist-packages
Requires: cffi
Required-by:

The strange thing is that this is the output I get in the new conda environment (it's the same!):

Name: SoundFile
Version: 0.10.3.post1
Summary: An audio library based on libsndfile, CFFI and NumPy
Home-page: https://github.com/bastibe/PySoundFile
Author: Bastian Bechtold
Author-email: basti@bastibe.de
License: BSD 3-Clause License
Location: /usr/local/lib/python3.6/dist-packages
Requires: cffi
Required-by: 

I cloned the old conda environment using

conda create --name NEWENV --file spec-file.txt
conda env update --name NEWENV --file environment.yml
pip install -r requirements.txt

I really don't understand why soundfile it's not working in the new environment even though it is set up exactly the same way. Any insights?

the_dummy
  • 317
  • 1
  • 3
  • 15
  • Did you activate the new environment? `conda activate NEWENV` – It_is_Chris Apr 14 '22 at 18:44
  • Yes, I am in the new environment – the_dummy Apr 14 '22 at 18:47
  • How are you running the python code? Are you using the correct python interpreter? – It_is_Chris Apr 14 '22 at 18:49
  • I'm writing in the command line `python -c 'import soundfile'` and I get ```Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'soundfile'``` whereas I don't get that in the old environment – the_dummy Apr 14 '22 at 18:51
  • Does everything look correct when you do `conda info` - e.g., the env name, location, etc.? – It_is_Chris Apr 14 '22 at 19:00
  • Yes, everything looks correct – the_dummy Apr 14 '22 at 19:11
  • And `conda list` shows the package? – It_is_Chris Apr 14 '22 at 19:12
  • `pip freeze` shows it... conda won't show it because `soundfile` is not available for a `conda install` – the_dummy Apr 14 '22 at 19:21
  • That should not matter. I just installed `SoundFile` with pip and it appears when I do `conda list` I am going to guess it is not installed correctly. Try removing the package from your new env and reinstall it using `pip install SoundFile` – It_is_Chris Apr 14 '22 at 19:24
  • You're right, I see it in the old environment but not in the new environment. I just uninstalled and reinstalled in the new environment but it still doesn't show in `conda list` – the_dummy Apr 14 '22 at 19:34
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/243912/discussion-between-it-is-chris-and-the-dummy). – It_is_Chris Apr 14 '22 at 19:37

0 Answers0