3

When I tried to install the librosa package using Conda, I got this error:

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - librosa -> python[version='>=2.7,<2.8.0a0|>=2.7|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.5|>=3.7|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.7,<3.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0',build='*_73_pypy|*_cpython|*_cpython|*_cpython|*_73_pypy|*_cpython|*_73_pypy']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

May I know how can I understand the specifications? Because there are so many Python versions it mentions and what I don't understand is how I can know Python is on the left most side of the chain or python appears to the right in this sentence:

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to.

And from the error message, how can I determine which version is okay to install? May I know which python version should I install to avoid the Python incompatibility error?

Here are all of the packages that I currently have installed:

# Name                    Version                   Build  Channel
_openmp_mutex             4.5                       2_gnu    conda-forge
_tflow_select             2.3.0                       mkl    anaconda
abseil-cpp                20200923.3           h01db608_0    conda-forge
absl-py                   1.2.0              pyhd8ed1ab_0    conda-forge
aiohttp                   3.8.1            py39h0fd3b05_1    conda-forge
aiosignal                 1.2.0              pyhd8ed1ab_0    conda-forge
astor                     0.8.1              pyh9f0ad1d_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
attrs                     22.1.0             pyh71513ae_1    conda-forge
blinker                   1.4                        py_1    conda-forge
brotlipy                  0.7.0           py39h0fd3b05_1004    conda-forge
bzip2                     1.0.8                hf897c2e_4    conda-forge
c-ares                    1.18.1               hf897c2e_0    conda-forge
ca-certificates           2022.6.15            h4fd8a4c_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                4.2.4              pyhd8ed1ab_0    conda-forge
certifi                   2022.6.15        py39h4420490_0    conda-forge
cffi                      1.15.1           py39hb26bf21_0    conda-forge
charset-normalizer        2.1.0              pyhd8ed1ab_0    conda-forge
click                     8.1.3            py39h4420490_0    conda-forge
cryptography              37.0.4           py39h32042e6_0    conda-forge
flatbuffers               2.0.6                h4de3ea5_0    conda-forge
frozenlist                1.3.1            py39h0fd3b05_0    conda-forge
gast                      0.4.0              pyh9f0ad1d_0    conda-forge
giflib                    5.2.1                hb9de7d4_2    conda-forge
google-auth               1.35.0             pyh6c4a22f_0    conda-forge
google-auth-oauthlib      0.4.6              pyhd8ed1ab_0    conda-forge
google-pasta              0.2.0              pyh8c360ce_0    conda-forge
grpcio                    1.46.3           py39h8a0731a_0    conda-forge
h5py                      3.6.0           nompi_py39hbdd1fc2_100    conda-for                                                                                ge
hdf5                      1.12.1          nompi_h7bde11e_104    conda-forge
icu                       68.2                 h3621d8e_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.4           py39ha65689a_0    conda-forge
jpeg                      9e                   h9cdd2b7_2    conda-forge
keras                     2.4.3              pyhd8ed1ab_0    conda-forge
keras-preprocessing       1.1.2              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h4e544f5_0    conda-forge
krb5                      1.19.3               h7c456eb_0    conda-forge
ld_impl_linux-aarch64     2.36.1               h02ad14f_2    conda-forge
libblas                   3.9.0           16_linuxaarch64_openblas    conda-f                                                                                orge
libcblas                  3.9.0           16_linuxaarch64_openblas    conda-f                                                                                orge
libcurl                   7.83.1               h8fd98b7_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h3557bc0_5    conda-forge
libgcc-ng                 12.1.0              h3242a24_16    conda-forge
libgfortran-ng            12.1.0              he9431aa_16    conda-forge
libgfortran5              12.1.0              h41d5c85_16    conda-forge
libgomp                   12.1.0              h3242a24_16    conda-forge
liblapack                 3.9.0           16_linuxaarch64_openblas    conda-f                                                                                orge
libnghttp2                1.47.0               h75cb1c7_0    conda-forge
libnsl                    2.0.0                hf897c2e_0    conda-forge
libopenblas               0.3.21          pthreads_h6cb6f83_0    conda-forge
libpng                    1.6.37               hf9034f9_3    conda-forge
libprotobuf               3.14.0               hc71ff50_0    conda-forge
libssh2                   1.10.0               h1ab2c7b_2    conda-forge
libstdcxx-ng              12.1.0              hd01590b_16    conda-forge
libuuid                   2.32.1            hf897c2e_1000    conda-forge
libzlib                   1.2.12               h4e544f5_2    conda-forge
markdown                  3.4.1              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.1            py39hb9a1dbb_1    conda-forge
multidict                 6.0.2            py39h0fd3b05_1    conda-forge
ncurses                   6.3                  headf329_1    conda-forge
numpy                     1.23.1           py39h7190128_0    conda-forge
oauthlib                  3.2.0              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1q               h4e544f5_0    conda-forge
opt_einsum                3.3.0              pyhd8ed1ab_1    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
protobuf                  3.14.0           py39h99ab00b_1    conda-forge
pyasn1                    0.4.8                      py_0    conda-forge
pyasn1-modules            0.2.7                      py_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyjwt                     2.4.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py39ha65689a_5    conda-forge
python                    3.9.13          h2eada40_0_cpython    conda-forge
python-flatbuffers        1.12               pyhd8ed1ab_1    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pyu2f                     0.1.5              pyhd8ed1ab_0    conda-forge
pyyaml                    6.0              py39h0fd3b05_4    conda-forge
readline                  8.1.2                h38e3740_0    conda-forge
requests                  2.28.1             pyhd8ed1ab_0    conda-forge
requests-oauthlib         1.3.1              pyhd8ed1ab_0    conda-forge
rsa                       4.9                pyhd8ed1ab_0    conda-forge
scipy                     1.9.0            py39h7b076ec_0    conda-forge
setuptools                64.0.1           py39ha65689a_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.9                hc7e91e1_1    conda-forge
sqlite                    3.39.2               hc74f5b8_0    conda-forge
tensorboard               2.5.0              pyhd8ed1ab_1    conda-forge
tensorboard-data-server   0.6.0            py39h3144da0_0    anaconda
tensorboard-plugin-wit    1.8.1              pyhd8ed1ab_0    conda-forge
tensorflow                2.5.0           mkl_py39h22df468_0    anaconda
tensorflow-base           2.5.0           mkl_py39ha7bf56e_0    anaconda
tensorflow-estimator      2.5.0              pyh81a9013_1    conda-forge
termcolor                 1.1.0              pyhd8ed1ab_3    conda-forge
tk                        8.6.12               hd8af866_0    conda-forge
typing-extensions         4.3.0                hd8ed1ab_0    conda-forge
typing_extensions         4.3.0              pyha770c72_0    conda-forge
tzdata                    2022b                h191b570_0    conda-forge
urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
werkzeug                  2.2.2              pyhd8ed1ab_0    conda-forge
wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
wrapt                     1.14.1           py39h0fd3b05_0    conda-forge
xz                        5.2.5                h6dd45c4_1    conda-forge
yaml                      0.2.5                hf897c2e_2    conda-forge
yarl                      1.7.2            py39h0fd3b05_2    conda-forge
zipp                      3.8.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.12               h4e544f5_2    conda-forge
Skully
  • 2,882
  • 3
  • 20
  • 31
Susan
  • 431
  • 1
  • 4
  • 16
  • 1
    I would go with most stable versions of Python. It is 2.7 for Python 2 and `3.7` for Python 3. `conda create -n myenv python=3.7` – mmustafaicer Aug 12 '22 at 17:27
  • 1
    I think the newest stable version of python is `3.10.6`. As a rule of thumb I would update, and I assume it would solve this issue, though the python requirements are strange IMO – Guy Aug 12 '22 at 17:30
  • 1
    You can Install different versions i.e 2.7, and 3.6 with conda https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python. It should work on 2.7 – DevAB Aug 12 '22 at 17:33
  • @Guy, when I search python in conda, I don't have 3.10.6. It shows from 3.6.7 to 3.10.5 – Susan Aug 12 '22 at 17:35
  • 1
    @Susan then I would try with `3.10.5` – Guy Aug 12 '22 at 17:36
  • 1
    [how to read specifications](https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications) It does explain the specific package requirements and how to read those. – mmustafaicer Aug 12 '22 at 17:38
  • @Susan I'll say that installing the package for my python `3.10.5` worked without problems (using pip, not conda) – Guy Aug 12 '22 at 17:41
  • @Guy, previously I tried installing ```conda install python=3.10```, it gives conflict error and take a long time to search incompatible packages in conda. Therefore I stop installing and search the python version. – Susan Aug 12 '22 at 17:43
  • By the way, May I know how can I install the package version in a range using conda? Because in pip, I can use ```Pip install “numpy >=1.20, <1.23” ``` But I don't know in conda how to define? Is it ```conda install -c conda-forge "numpy >=1.20, <1.23"```? – Susan Aug 12 '22 at 17:53
  • Thank you @mmustafaicer, I understand the specification. Do you know what does python on the left-most side and right means in this sentence? ```If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to.``` – Susan Aug 12 '22 at 18:10
  • `librosa -> python` python appears to the right. It means your librosa library was not compatible with `3.9` version. If you look at the specifications compatibility brackets of this certain library is pretty confusing. `<2.8.0a0|>=2.7|>=3.10`. Newer than 2.7 but also 3.10.. It is really contradictory. – mmustafaicer Aug 12 '22 at 18:27
  • `<2.8.0a0|>=2.7|>=3.10` means it should be less than 2.8 but higher or equal than 2.7. Which `2.7.0` and `2.7.1` are all ok. but `2.8.0` or `2.8.1` is not ok. I hope this is much clearer. – mmustafaicer Aug 12 '22 at 18:36
  • Thank you for the concise explanation. I understand now. By the way, I also tried python with both 3.7 and 3.10 versions but it gives the same error when I try to install librosa after updating the python version. Moreover I also tried with ```conda install -c conda-forge python librosa```. Unluckily, conda cannot install librosa and python due to the package version mismatch – Susan Aug 12 '22 at 18:57
  • ```Package pycparser conflicts for: brotlipy -> cffi[version='>=1.0.0'] -> pycparser[version='>=2.06'] cffi -> pycparser[version='>=2.06'] pycparser cryptography -> cffi[version='>=1.12'] -> pycparser[version='>=2.06']``` – Susan Aug 12 '22 at 18:57
  • In this case, can I install librosa with pip instead of conda? As conda gives python version error. What I want to know is if I install librosa with pip, will it generate any error while running the python script due to using both conda and pip while installing the packages? – Susan Aug 12 '22 at 19:02

1 Answers1

0

Major Architectures

It is definitely not a conflict with Python version. For example, all the following solve without issue for me:

CONDA_SUBDIR=linux-64 conda create -dn foo python=3.9 librosa
CONDA_SUBDIR=osx-64 conda create -dn foo python=3.9 librosa
CONDA_SUBDIR=win-64 conda create -dn foo python=3.9 librosa

Rather, Conda is notoriously bad at reporting why it can't solve things. If you are interested in figuring out what is actually conflicting, I recommend trying Mamba:

conda install -n base -c conda-forge mamba
mamba install librosa

Otherwise, if you only care about getting up and running with librosa, then create a new environment:

conda create -n whatever librosa python=3.9

and use whatever Python version you want, though 3.8-3.10 are the only active versions (3.7 is in security-only mode and hits EOL June 2023).


Other Architectures

The above, however, does not apply to OP's case, which is solving for linux-aarch64 architecture. At the time of question, Conda Forge did not yet offer linux-aarch64 builds for audioread. It is now available, so please try again, installing audioread from Conda Forge channel.

One can check whether a compatible version of a package is available on a specific architecture by using the --subdir argument of conda search, e.g., checking if tensorflow is available:

conda search --subdir linux-aarch64 tensorflow

though you shouldn't need the --subdir argument if the system you are on has the architecture you want to search - Conda will automatically use that subdir (shows up in conda info).

Generally, one can ask for a package to be built for linux-aarch64 by adding it to the "arch_rebuild.txt" list via a Pull Request on this repository.1

PyPI

In the meantime, Conda does have an option to consider packages installed from PyPI in its solver. This option is:

% conda config --describe pip_interop_enabled
# # pip_interop_enabled (bool)
# #   Allow the conda solver to interact with non-conda-installed python
# #   packages.
# # 
# pip_interop_enabled: false

That is, you want (at least temporarily) to use:

conda config --set pip_interop_enabled true
pip install audioread
mamba install librosa

Further Possibilities

The installation may still not work if other dependencies of librosa also lack linux-aarch64 builds. In which case, you'll have to request builds or try installing through pip install.


[1] In brief, edit the arch_rebuild.txt file to appended the package name you would like built for aarch64. Submit this as the PR.

merv
  • 67,214
  • 13
  • 180
  • 245
  • Thank you for your advice. May I know if I use mamba, do I need to install all the packages with mamba? or Can I install some packages with mamba and some packages with conda? May I know what is the difference between using mamba and conda and pip? – Susan Aug 13 '22 at 02:11
  • When I install librosa with mamba, I got this error – Susan Aug 13 '22 at 02:14
  • ```Looking for: ['librosa'] conda-forge/linux-aarch64 Using cache conda-forge/noarch Using cache warning libmamba Could not parse mod/etag header anaconda/linux-aarch64 Using cache anaconda/noarch default/linux-aarch64 No change default/noarch No change ``` – Susan Aug 13 '22 at 02:16
  • ```Pinned packages: - python 3.7.* Encountered problems while solving: - nothing provides audioread >=2.0.0 needed by librosa-0.6.1-py_1 ``` May I know the issue is due to not having audioread>=2.0.0? Should I install audioread=2.0.0 using conda or mamba? – Susan Aug 13 '22 at 02:16
  • When I install audioread with mamba ```mamba install audioread```, It said ```Pinned packages: - python 3.7.* Encountered problems while solving: - nothing provides requested audioread ```. So I install audioread with pip ```pip install audioread```. Audioread 3.0.0 is successfully installed via pip while conda and mamba cannot install audioread. After that when I install librosa with mamba, I got the same issue of ```nothing provides audioread>=2.0.0 needed by librosa-0.6.1-py_1```. May I know how can I solve the issue to be able to install librosa? I am using linux aarch64. – Susan Aug 13 '22 at 02:21
  • I also tried creating new environment ```conda create -n whatever librosa python=3.9``` It said ```Found conflicts! Looking for incompatible packages. failed UnsatisfiableError: The following specifications were found to be incompatible with each other: ``` – Susan Aug 13 '22 at 02:27
  • ```Output in format: Requested package -> Available versions Package python conflicts for: librosa -> python[version='>=3.6'] python=3.9 librosa -> decorator[version='>=4.0.10'] -> python[version='>=2.7,<2.8.0a0|>=2.7|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.5|>=3.7|>=3.8,<3.9.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0',build='*_73_pypy|*_73_pypy|*_cpython|*_cpython|*_73_pypy|*_cpython'] ``` – Susan Aug 13 '22 at 02:27
  • @Susan updated; I didn't realize you had an aarch64 chip - that's a different issue. Rather, there really aren't some packages for it yet. But if you ask, they'll get built eventually. – merv Aug 13 '22 at 03:52
  • Thank you for your advice. As this is my first time to raise a build request via pull request, can you guide me how can I request "Conda forge to offer linux-aarch64 builds for not only audioread package but also librosa and the dependency package of librosa" via pull request in the website https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/migrations/arch_rebuild.txt ? I found pull request button beside Issue button at the top. But I don't know how to proceed the request? – Susan Aug 13 '22 at 15:56
  • May I know should I comment those 2 lines before installing audioread and librosa ```% conda config --describe pip_interop_enabled``` ```conda config --set pip_interop_enabled true```? – Susan Aug 13 '22 at 15:59
  • @Susan if you have `audioread` installed through `pip`, then you need to at least run the second one (with `--set`). As for the request, I have one building, but just waiting on review. That should be available in ~ 24 hours. Otherwise, I have added a note to the answer for future reference. – merv Aug 14 '22 at 00:40
  • @Susan heads up that `audioread` is now on Conda Forge, so please retry installing everything from Conda Forge. – merv Aug 14 '22 at 17:11
  • Thank you for the information. May I know how about librosa package? Can I use conda forge channel to install librosa in aarch64 architecture? – Susan Aug 15 '22 at 01:46
  • when I install ```audioread``` using ```conda install -c conda-forge audioread```, it gives the following error. ```InvalidArchiveError("Error with archive /home/su/miniconda3/python-package/nettle-3.8.1-hcc5b78b_1.tar.bz2. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nFailed to open '/home/su/miniconda3/python-package/nettle-3.8.1-hcc5b78b_1.tar.bz2'")```. When I check the folder ```/home/su/miniconda3/python-package/```, I found there is a folder called ```nettle-3.8.1-hcc5b78b_1```. – Susan Aug 15 '22 at 08:12
  • So I delete that folder. But I don't find nettle-3.8.1-hcc5b78b_1.tar.bz2 file. I also did ```conda config --set pip_interop_enabled true``` before installing the audioread via conda. May I know how can I solve the issue? – Susan Aug 15 '22 at 08:12
  • @Susan `librosa` is already a **noarch** build on Conda Forge - it will work if the dependencies work. You should set `pip_interop_enabled` back to false. – merv Aug 15 '22 at 12:54
  • Thank you for your help and advice. I can install librosa via conda and got no issue. May I know how can I check whether the packages are available in aarch64 architecture? Because for tensorflow, I can install the tensorflow via conda in aarch64 linux machine successfully. But when I run the script and predict the model, I got ```I tensorflow/compiler/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2) I tensorflow/core/platform/profile_utils/cpu_utils.cc: 114] CPU Frequency: 24000000 Hz Illegal instruction (core dumped)```. – Susan Aug 16 '22 at 06:48
  • I am not sure how can I fix the tensorflow issue. – Susan Aug 16 '22 at 06:49
  • @Susan I added a paragraph on using `conda search`. This comment section has become too long. If you have further questions, please ask them as new posts. I believe the original question has been sufficiently answered. – merv Aug 16 '22 at 13:46