I'm trying to build a package which includes h5py. When using conda build, it seems to install the wrong version of the dependency. It installs 3.2.1-py37h6c542dc_0, which includes hdf5: 1.10.6-nompi_h6a2412b_1114.
The problem is that this hdf5 lib, seems to have these setting:
(Read-Only) S3 VFD: yes
This causes an error for me. When just running conda install h5py==3.2.1, it does install the right version (hdf5-1.10.6-nompi_h3c11f04_101).
Why is there a difference?
"Why is there a difference?
Using conda install h5py=3.2.1 additionally includes all the previous constraints in the current environment, whereas during a conda build run, a new environment is created only with requirements that the package specifies. That is, it is more like running conda create -n foo h5py=3.2.1.
So, that covers the mechanism, but we can also look at the particular package dependencies to see why the current environment constrains to the older hdf5-1.10.6-nompi_h3c11f04_101, which OP states is preferred. Here is the package info for the two:
hdf5-1.10.6-nompi_h6a2412b_1114
$ mamba search --info conda-forge/linux-64::hdf5[version='1.10.6',build='nompi_h6a2412b_1114']
hdf5 1.10.6 nompi_h6a2412b_1114
-------------------------------
file name : hdf5-1.10.6-nompi_h6a2412b_1114.tar.bz2
name : hdf5
version : 1.10.6
build : nompi_h6a2412b_1114
build number: 1114
size : 3.1 MB
license : LicenseRef-HDF5
subdir : linux-64
url : https://conda.anaconda.org/conda-forge/linux-64/hdf5-1.10.6-nompi_h6a2412b_1114.tar.bz2
md5 : 0a2984b78f51148d7ff6219abe73509e
timestamp : 2021-01-08 23:10:11 UTC
dependencies:
- libcurl >=7.71.1,<8.0a0
- libgcc-ng >=9.3.0
- libgfortran-ng
- libgfortran5 >=9.3.0
- libstdcxx-ng >=9.3.0
- openssl >=1.1.1i,<1.1.2a
- zlib >=1.2.11,<1.3.0a0
hdf5-1.10.6-nompi_h3c11f04_101
$ mamba search --info conda-forge/linux-64::hdf5[version='1.10.6',build='nompi_h3c11f04_101']
hdf5 1.10.6 nompi_h3c11f04_101
------------------------------
file name : hdf5-1.10.6-nompi_h3c11f04_101.tar.bz2
name : hdf5
version : 1.10.6
build : nompi_h3c11f04_101
build number: 101
size : 3.0 MB
license : HDF5
subdir : linux-64
url : https://conda.anaconda.org/conda-forge/linux-64/hdf5-1.10.6-nompi_h3c11f04_101.tar.bz2
md5 : 9f1ccc4d36edf8ea15ce19f52cf6d601
timestamp : 2020-07-31 12:26:29 UTC
dependencies:
- libgcc-ng >=7.5.0
- libgfortran-ng >=7,<8.0a0
- libstdcxx-ng >=7.5.0
- zlib >=1.2.11,<1.3.0a0
The difference here is that the latter works with older versions of libgcc-ng, libstdcxx-ng, and libgfortran-ng (below 9.3.0), as well as has no constraint on openssl or libcurl. So, we can guess that the current environment where the conda install h5py=3.2.1 was invoked has one of these restrictions.
Related
conda packages (can) have a summary and description in their metadata. I'd like to read those somehow using conda, to help decide what packages to install. However, the most information I can find is from conda search -i, e.g.
$ conda search -i optionsfactory
Loading channels: done
optionsfactory 1.0.3 py_0
-------------------------
file name : optionsfactory-1.0.3-py_0.tar.bz2
name : optionsfactory
version : 1.0.3
build : py_0
build number: 0
size : 22 KB
license : BSD-3-Clause
subdir : noarch
url : https://conda.anaconda.org/conda-forge/noarch/optionsfactory-1.0.3-py_0.tar.bz2
md5 : f8db4dd5600ad38b5f6ecae5f6f7d2ad
timestamp : 2020-05-13 08:04:25 UTC
dependencies:
- python >=3.6
which isn't helpful for finding out what the package actually does.
I'm getting this error when attempting to install a package:
(pybert-tst)
dbanas#Davids-MacBook-Pro:~/Documents/Projects/PyBERT
$ conda install -c dbanas pybert
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- pybert
Use "conda search <package> --info" to see the dependencies for each package.
But, I see the pybert package when I search:
(pybert-tst)
dbanas#Davids-MacBook-Pro:~/Documents/Projects/PyBERT
$ conda search -c dbanas pybert --info
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Loading channels: done
pybert 3.1.0 pyh7b7c402_2
-------------------------
file name : pybert-3.1.0-pyh7b7c402_2.tar.bz2
name : pybert
version : 3.1.0
build : pyh7b7c402_2
build number: 2
size : 235 KB
license : BSD License
subdir : noarch
url : https://conda.anaconda.org/dbanas/noarch/pybert-3.1.0-pyh7b7c402_2.tar.bz2
md5 : 9537824117ffca8bd024f74cd0f44c7a
timestamp : 2019-07-16 22:18:08 UTC
dependencies:
- chaco
- docutils
- enable
- jinja2
- kiwisolver
- numpy
- pygments
- pyibis-ami >=3.0.0
- python >=3.7.0,<3.8
- scikit-rf
- scipy
- sphinx
- traits
- traitsui
Does anyone know what's going on?
This was caused by two dependencies of the pybert package being locked to Python 2.7, while Python itself was calling for Python 3.7.
I sure would've been nice to have seen the names of those two other packages in the error message. :(
I am trying to install fiona=1.6 but I get the following error
conda install fiona=1.6
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: -
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- conda-forge/noarch::flask-cors==3.0.7=py_0
- conda-forge/osx-64::blaze==0.11.3=py36_0
- conda-forge/noarch::flask==1.0.2=py_2
failed
PackagesNotFoundError: The following packages are not available from current channels:
- fiona=1.6 -> gdal==1.11.4
Current channels:
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
If I try to install gdal==1.11.4, I get the following
conda install -c conda-forge gdal=1.11.4
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: |
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- conda-forge/noarch::flask-cors==3.0.7=py_0
- conda-forge/osx-64::blaze==0.11.3=py36_0
- conda-forge/noarch::flask==1.0.2=py_2
failed
PackagesNotFoundError: The following packages are not available from current channels:
- gdal=1.11.4
Current channels:
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/osx-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
This is the result of conda info
conda info
active environment : base
active env location : /anaconda3
shell level : 1
user config file : /Users/massaro/.condarc
populated config files : /Users/massaro/.condarc
conda version : 4.6.11
conda-build version : 3.17.8
python version : 3.6.8.final.0
base environment : /anaconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /anaconda3/pkgs
/Users/massaro/.conda/pkgs
envs directories : /anaconda3/envs
/Users/massaro/.conda/envs
platform : osx-64
user-agent : conda/4.6.11 requests/2.21.0 CPython/3.6.8 Darwin/17.5.0 OSX/10.13.4
UID:GID : 502:20
netrc file : None
Python Versions
The Conda Forge channel only has gdal v1.11.4 for Python 2.7, 3.4, and 3.5. You either need to use a newer version of Fiona (current is 1.8) or make a new env that includes one of those older Python versions.
For example,
conda create -n fiona_1_6 fiona=1.6 python=3.5
Channel defaults is Required
Another issue you face is that you have removed the defaults channel from your configuration (as per your conda info). It is impossible to install fiona=1.6 with only the conda-forge channel. My recommendation would be to have both conda-forge and defaults in your configuration, but just set conda-forge to have higher priority (if that's what you want). You can do this like so,
conda config --append channels defaults
If you really don't want to include defaults, but just want a temporary workaround, then you can simply run the first command with a --channels | -c flag
conda create -n fiona_1_6 -c conda-forge -c defaults fiona=1.6 python=3.5
This will still give conda-forge precedence, but allow missing dependencies to be sourced from defaults.
Environment File
If you have more than just Fiona that you require, it may be cleaner to put together a requirements file, like so
fiona_1_6.yaml
name: fiona_1_6
channels:
- conda-forge
- defaults
dependencies:
- python=3.5
- fiona=1.6
- osmnx
Then create the new environment with this:
conda env create -f fiona_1_6.yaml
Doing what the error message told me to,
To search for alternate channels that may provide the conda package you're
looking for, navigate to https://anaconda.org
and typing in gdal in the search box led me to https://anaconda.org/conda-forge/gdal which has this installation instruction:
conda install -c conda-forge gdal=1.11.4
Try that to install the gdal dependency, maybe?
I would like to downgrade Python from 3.6 to 3.5. conda tells me the following:
$ conda install python=3.5.0 -n myenv
Fetching package metadata .........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- ppft -> python 3.6* -> xz 5.2.*
- python 3.5.0*
Now knowing any of the packages in the first line, conda info ppft gives me ResolvePackageNotFound. conda info xz gives me a long list of versions, the latest of which is
xz 5.2.3 0
----------
file name : xz-5.2.3-0.tar.bz2
name : xz
version : 5.2.3
build string: 0
build number: 0
channel : defaults
size : 667 KB
arch : x86_64
date : 2017-08-18
license : Public-Domain, GPL
license_family: GPL2
md5 : 585458787b315ac1e5fb3a1ee71cad75
noarch : None
platform : linux
url : https://repo.continuum.io/pkgs/free/linux-64/xz-5.2.3-0.tar.bz2
dependencies:
How do I continue - what's going on?
First off ppft is not listed in the default anaconda directory but in conda-forge. But if you take a look at the files in that directory you will find there are versions for python 3.5. Furthermore according to the homepage for xz, it is compatible with python 2 or 3.
One option would be to remove the conflicting libraries, downgrade to 3.5, and then reinstall the libraries later. For example
conda uninstall ppft xz
conda install python=3.5 -n myenv
conda install xz
conda install -c conda-forge ppft
I have Anaconda 4.3.23 on Ubuntu 16.04 LTS. When I try to install pydot-ng package using
conda install pydot-ng
I get the following error:
UnsatisfiableError: The following specifications were found to be in conflict:
- pydot-ng -> python 2.7* -> openssl 1.0.1*
- python 3.6*
Use "conda info <package>" to see the dependencies for each package.
Upon running conda info pydot-ng i see
pydot-ng 1.0.0.15 py27_0
------------------------
file name : pydot-ng-1.0.0.15-py27_0.tar.bz2
name : pydot-ng
version : 1.0.0.15
build string: py27_0
build number: 0
channel : defaults
size : 45 KB
arch : x86_64
date : 2015-09-09
license : MIT
md5 : 8b81a344723e64ec3545b5f030caca47
noarch : None
platform : linux
url : https://repo.continuum.io/pkgs/free/linux-64/pydot-ng-
1.0.0.15-py27_0.tar.bz2
dependencies:
pyparsing
python 2.7*
pydot-ng 1.0.0.15 py34_0
------------------------
file name : pydot-ng-1.0.0.15-py34_0.tar.bz2
name : pydot-ng
version : 1.0.0.15
build string: py34_0
build number: 0
channel : defaults
size : 46 KB
arch : x86_64
date : 2015-09-09
license : MIT
md5 : 13e3a10b45edfb38d91a51d6b3ccabc7
noarch : None
platform : linux
url : https://repo.continuum.io/pkgs/free/linux-64/pydot-ng-
1.0.0.15-py34_0.tar.bz2
dependencies:
pyparsing
python 3.4*
What is the problem? Shouldn't conda be able to install the pydot-ng 1.0.0.15 py34_0 version which would be compatible with python 3.6 (I presume)?
That's not how conda works - the package is built for a specific version of Python, unless the package builder specifically says that its a universal package and can be installed for many versions. The simplest solution to this is to create a new environment to install this package:
conda create -n pydotng python=3.4 pydot-ng