2

I'm new to Python (I installed the Anaconda distribution a couple weeks ago on my windows 10 machine) and am having trouble getting the pysoundfile library to import from the Spyder ipython console. These are the steps I followed:

1) I found the instructions for installing pysound here: https://anaconda.org/conda-forge/pysoundfile

2) At ipython console within Spyder I typed:
conda install -c conda-forge pysoundfile

This gave me a warning that I needed to restart the kernel, which I then did by closing ipython and having a new console open (I also tried quitting python down and re-opening)

3) From ipython, I typed

import pysoundfile

This gave me the following message: ModuleNotFoundError: No module named 'pysoundfile'

I repeated step 2 again, but this time got the long error below after executing the conda command.

I'm not sure what I'm doing wrong.

Any help would be much appreciated. Thank you.


conda install -c conda-forge pysoundfile
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

Note: you may need to restart the kernel to use updated packages.

Finding conflicts:   0%|          | 0/11 [00:00<?, ?it/s]
Examining ca-certificates:   0%|          | 0/11 [00:00<?, ?it/s]
Examining openssl:   9%|9         | 1/11 [00:00<?, ?it/s]        
Examining vc:  18%|#8        | 2/11 [00:00<?, ?it/s]     
Examining sqlite:  27%|##7       | 3/11 [00:00<?, ?it/s]
Examining pip:  36%|###6      | 4/11 [00:00<?, ?it/s]   
Examining wheel:  45%|####5     | 5/11 [00:00<?, ?it/s]
Examining certifi:  55%|#####4    | 6/11 [00:00<?, ?it/s]
Examining python:  64%|######3   | 7/11 [00:00<?, ?it/s] 
Examining setuptools:  73%|#######2  | 8/11 [00:00<00:00, 8000.58it/s]
Examining wincertstore:  82%|########1 | 9/11 [00:00<00:00, 9000.65it/s]
Examining vs2015_runtime:  91%|######### | 10/11 [00:00<00:00, 10000.72it/s]


UnsatisfiableError: The following specifications were found to be incompatible with each other:



Package cffi conflicts for:

pysoundfile -> cffi
Package vc conflicts for:
python=3.7 -> vc[version='14.*|>=14,<15.0a0|>=14.1,<15.0a0']
Package numpy conflicts for:
pysoundfile -> numpy
Package libsndfile conflicts for:
pysoundfile -> libsndfile
Package openssl conflicts for:
python=3.7 -> openssl[version='>=1.1.1a,<1.1.2a|>=1.1.1b,<1.1.2a|>=1.1.1c,<1.1.2a|>=1.1.1d,<1.1.2a']
Package libgcc-ng conflicts for:
pysoundfile -> libgcc-ng[version='>=4.9|>=7.3.0']
Package pip conflicts for:
python=3.7 -> pip
Package sqlite conflicts for:
python=3.7 -> sqlite[version='>=3.25.3,<4.0a0|>=3.26.0,<4.0a0|>=3.27.2,<4.0a0|>=3.28.0,<4.0a0|>=3.29.0,<4.0a0|>=3.30.1,<4.0a0']
Package vs2015_runtime conflicts for:
python=3.7 -> vs2015_runtime[version='>=14.16.27012,<15.0a0']
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
jds
  • 33
  • 4
  • How about `import soundfile as sf`? – neurite Dec 25 '19 at 23:29
  • Thank you for the suggestion, however that gives me the same error message --> ModuleNotFoundError: No module named 'soundfile' – jds Dec 25 '19 at 23:37
  • 1
    I think the problem is with the installation of the pysoundfile library, not with import, because when I type "conda list" neither pysoundfile nor soundfile appear in the list. – jds Dec 25 '19 at 23:40
  • I created a new env from scratch `conda create --name temp python=3.6`. Then `conda activate temp` and `conda install -c conda-forge pysoundfile`. After that, `import soundfile as sf` works fine. Note that I use python 3.6. I am on a Mac by the way – neurite Dec 26 '19 at 00:10
  • Actually python 3.7 also works for me. – neurite Dec 26 '19 at 00:16
  • Thank you neurite for your help. Just a couple more questions. Are you executing the "conda create --name temp" command at the ipython prompt in Spyder? When I typed that (with or without adding "python=3.7"), there was no response after I hit enter. It just hangs up, even after waiting minutes. – jds Dec 26 '19 at 01:33
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/204855/discussion-between-jds-and-neurite). – jds Dec 26 '19 at 02:06
  • I thought the probelm might have been that I was executing conda within the ipython window of Spyder, so I then tried executing conda commands within Anaconda prompt (Anaconda 3). When i did this, I got the following error after the "conda install -c conda-forge pysoundfile" ------ -- "UnsatisfiableError: The following specifications were found to be incompatible with each other:" it then listed a bunch of other packages that conflicted with pysoundfile. Any help resolving this would be much appreciated. – jds Dec 26 '19 at 02:22

1 Answers1

0

I was able to install Pysoundfile and here's the steps I followed:

  1. Open Anaconda Prompt program from Windows
  2. Type "pip install soundfile"
  3. Start Spyder program in Windows
  4. At ipython console prompt, type "import soundfile"

I'm not sure why the conda commands others were able to use did not work for me, but since I have a solution, I'm all set for now.

Thank you for everyone for your suggestions.

jds
  • 33
  • 4