how to install conflicting packages? - python

I have both anaconda for python 2.7 and for python 3 installed on my machine.
I am trying to install user-agents (https://github.com/selwin/python-user-agents) and I get the following error:
(base) C:\Users\john>conda install user-agents
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- user-agents
- zict
Use "conda info <package>" to see the dependencies for each package.
I have looked at the FAQ https://conda.io/docs/user-guide/tasks/manage-python.html but I do not understand how to avoid this issue. Running the -info command on both packages shows
(base) C:\Users\john>conda info user-agents
user-agents 1.1.0 py27_0
------------------------
file name : user-agents-1.1.0-py27_0.tar.bz2
name : user-agents
version : 1.1.0
build string: py27_0
build number: 0
channel : https://conda.anaconda.org/conda-forge/win-64
size : 16 KB
arch : x86_64
constrains : ()
license : MIT
license_family: MIT
md5 : 98e6b4d286813445d0a2f222ca3f08fa
platform : win32
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/user-agents-1.1.0-py27_0.tar.bz2
dependencies:
python 2.7*
ua-parser >=0.4.1
user-agents 1.0.1 py34_0
------------------------
file name : user-agents-1.0.1-py34_0.tar.bz2
name : user-agents
version : 1.0.1
build string: py34_0
build number: 0
channel : https://conda.anaconda.org/conda-forge/win-64
size : 12 KB
arch : x86_64
constrains : ()
license : MIT
md5 : 960c836c6c8fd5e7a126c15b39be5d35
platform : win32
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/user-agents-1.0.1-py34_0.tar.bz2
dependencies:
python 3.4*
ua-parser >=0.4.1
user-agents 1.0.1 py27_1
------------------------
file name : user-agents-1.0.1-py27_1.tar.bz2
name : user-agents
version : 1.0.1
build string: py27_1
build number: 1
channel : https://conda.anaconda.org/conda-forge/win-64
size : 13 KB
arch : x86_64
constrains : ()
license : MIT
md5 : 9c829288911183766ddaa741f537b6ca
platform : win32
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/user-agents-1.0.1-py27_1.tar.bz2
dependencies:
python 2.7*
ua-parser >=0.4.1
user-agents 1.0.1 py27_0
------------------------
file name : user-agents-1.0.1-py27_0.tar.bz2
name : user-agents
version : 1.0.1
build string: py27_0
build number: 0
channel : https://conda.anaconda.org/conda-forge/win-64
size : 12 KB
arch : x86_64
constrains : ()
license : MIT
md5 : 5f8bff4eecc0921d8ff6637c5214a69d
platform : win32
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/user-agents-1.0.1-py27_0.tar.bz2
dependencies:
python 2.7*
ua-parser >=0.4.1
user-agents 1.0.1 py34_1
------------------------
file name : user-agents-1.0.1-py34_1.tar.bz2
name : user-agents
version : 1.0.1
build string: py34_1
build number: 1
channel : https://conda.anaconda.org/conda-forge/win-64
size : 13 KB
arch : x86_64
constrains : ()
license : MIT
md5 : 968c308d3f28527d010ab1ea7e08f043
platform : win32
subdir : win-64
url : https://conda.anaconda.org/conda-forge/win-64/user-agents-1.0.1-py34_1.tar.bz2
dependencies:
python 3.4*
ua-parser >=0.4.1
Can someone please tell me what is the correct conda command here?
Thanks!

Related

conda install and conda build result in different dependency versions

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.

How do I see the summary or description for a conda package?

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.

Conda updates packages that I don't use

I noticed a strange behavior. I ran conda update --all in base environment and got the following output:
The following packages will be downloaded:
package | build
---------------------------|-----------------
conda-4.8.3 | py37_0 2.8 MB
idna-2.9 | py_1 49 KB
pycparser-2.20 | py_0 92 KB
tqdm-4.43.0 | py_0 56 KB
------------------------------------------------------------
Total: 3.0 MB
I don't have tqdm package installed, though conda updates it. Why is this happening? When I run conda list -n base there is no package tqdm, neither in any other environment.
Thanks!
conda depends on conda-package-handling
conda-package-handling depends on tqdm
if you don't think you have it installed, you need to look closer. conda update --all will try to update anything you have installed.
$ conda search conda=4.8.3=py37_0 --info
Loading channels: done
conda 4.8.3 py37_0
------------------
file name : conda-4.8.3-py37_0.conda
name : conda
version : 4.8.3
build : py37_0
build number: 0
size : 2.8 MB
license : BSD 3-Clause
subdir : linux-ppc64le
url : https://repo.anaconda.com/pkgs/main/linux-ppc64le/conda-4.8.3-py37_0.conda
md5 : 50d4443514e3e27b11228cee8aef3653
timestamp : 2020-03-13 16:59:23 UTC
constraints :
- conda-build >=3
- conda-env >=2.6
- cytoolz >=0.8.1
dependencies:
- conda-package-handling >=1.3.0
- pycosat >=0.6.3
- pyopenssl >=16.2.0
- python >=3.7,<3.8.0a0
- requests >=2.18.4,<3
- ruamel_yaml >=0.11.14,<0.16
- setuptools >=31.0.1
$ conda search conda-package-handling=1.3.0=py37_0 --info
Loading channels: done
conda-package-handling 1.3.0 py37_0
-----------------------------------
file name : conda-package-handling-1.3.0-py37_0.tar.bz2
name : conda-package-handling
version : 1.3.0
build : py37_0
build number: 0
size : 252 KB
license : BSD-3-Clause
subdir : linux-ppc64le
url : https://repo.anaconda.com/pkgs/main/linux-ppc64le/conda-package-handling-1.3.0-py37_0.tar.bz2
md5 : 0bcb9ed3ca68eb7fa5d1c4a7ede55de1
timestamp : 2019-06-10 18:58:25 UTC
dependencies:
- libarchive >=3.3.3
- python >=3.7,<3.8.0a0
- python-libarchive-c
- six
- tqdm

Resolving conflict with urllib3 to install AWS elastic beanstalk CLI using anaconda on Macos?

I'm trying to install the cli for aws elastic beanstalk using conda install -c davidbgonzalez awsebcli but I keep running into this error:
/Users/deepak/.local/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- awsebcli
- urllib3
Use "conda info <package>" to see the dependencies for each package.
Now this error appeared for many libraries- not just urllib3; but for each of those I was able to resolve by using either conda uninstall or pip install --upgrade. However, for urllib3, if I uninstall, the conda command itself doesn't work, as it says requests package not found, and if I update urllib3- it makes no difference, the conflict remains and I cant move forward with my awsebcli installation.
Help?
PS: I use a MacOS with conda 4.5.9 installation with python 2.7.14.
I tried a pip install awsebcli- and it installed properly, but I'm not able to locate the executable and thus not sure how to include it into the '$PATH' variable. So, I'm guessing I need to use conda install as that is the main python I use everywhere.
UPDATE:
this is the result of conda info urllib3
/Users/deepak/.local/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
urllib3 1.21.1 py27_0
---------------------
file name : urllib3-1.21.1-py27_0.tar.bz2
name : urllib3
version : 1.21.1
build string: py27_0
build number: 0
channel : https://repo.anaconda.com/pkgs/free/osx-64
size : 151 KB
arch : x86_64
constrains : ()
date : 2017-06-21
license : MIT
license_family: MIT
md5 : 57332c18a93a2d82131212d52a0bafbf
platform : darwin
subdir : osx-64
url : https://repo.anaconda.com/pkgs/free/osx-64/urllib3-1.21.1-py27_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
ipaddress
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python 2.7*
urllib3 1.21.1 py36_0
---------------------
file name : urllib3-1.21.1-py36_0.tar.bz2
name : urllib3
version : 1.21.1
build string: py36_0
build number: 0
channel : https://repo.anaconda.com/pkgs/free/osx-64
size : 153 KB
arch : x86_64
constrains : ()
date : 2017-06-21
license : MIT
license_family: MIT
md5 : 676e7d5b7366f2636edde60a528dbb22
platform : darwin
subdir : osx-64
url : https://repo.anaconda.com/pkgs/free/osx-64/urllib3-1.21.1-py36_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python 3.6*
urllib3 1.21.1 py35_0
---------------------
file name : urllib3-1.21.1-py35_0.tar.bz2
name : urllib3
version : 1.21.1
build string: py35_0
build number: 0
channel : https://repo.anaconda.com/pkgs/free/osx-64
size : 154 KB
arch : x86_64
constrains : ()
date : 2017-06-21
license : MIT
license_family: MIT
md5 : 1c5e2fdfed928117f86c0a89c0b97b19
platform : darwin
subdir : osx-64
url : https://repo.anaconda.com/pkgs/free/osx-64/urllib3-1.21.1-py35_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python 3.5*
urllib3 1.23 py35_0
-------------------
file name : urllib3-1.23-py35_0.tar.bz2
name : urllib3
version : 1.23
build string: py35_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 152 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : 7e349638ccb5faad1b2f4378657e969f
platform : None
subdir : osx-64
timestamp : 1529348179047
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.23-py35_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=3.5,<3.6.0a0
urllib3 1.23 py27_0
-------------------
file name : urllib3-1.23-py27_0.tar.bz2
name : urllib3
version : 1.23
build string: py27_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 150 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : 10fa8961318553993367293d607cd870
platform : None
subdir : osx-64
timestamp : 1529348370587
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.23-py27_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
ipaddress
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=2.7,<2.8.0a0
urllib3 1.22 py35he002d57_0
---------------------------
file name : urllib3-1.22-py35he002d57_0.tar.bz2
name : urllib3
version : 1.22
build string: py35he002d57_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 156 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : caf79d85b6ad4c487988886198b7ad36
platform : None
subdir : osx-64
timestamp : 1505923648539
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.22-py35he002d57_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=3.5,<3.6.0a0
urllib3 1.23 py36_0
-------------------
file name : urllib3-1.23-py36_0.tar.bz2
name : urllib3
version : 1.23
build string: py36_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 152 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : f582f82965d2bbdd0ac3b5b034ee2af4
platform : None
subdir : osx-64
timestamp : 1529348338677
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.23-py36_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=3.6,<3.7.0a0
urllib3 1.23 py37_0
-------------------
file name : urllib3-1.23-py37_0.tar.bz2
name : urllib3
version : 1.23
build string: py37_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 152 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : 3cf975556522788681a2c6caf7a955ae
platform : None
subdir : osx-64
timestamp : 1530723151837
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.23-py37_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=3.7,<3.8.0a0
urllib3 1.22 py27hc3787e9_0
---------------------------
file name : urllib3-1.22-py27hc3787e9_0.tar.bz2
name : urllib3
version : 1.22
build string: py27hc3787e9_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 153 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : 5c91bc08e0a7c2cf3726fea8bc6c504e
platform : None
subdir : osx-64
timestamp : 1505923615525
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.22-py27hc3787e9_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
ipaddress
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=2.7,<2.8.0a0
urllib3 1.22 py36h68b9469_0
---------------------------
file name : urllib3-1.22-py36h68b9469_0.tar.bz2
name : urllib3
version : 1.22
build string: py36h68b9469_0
build number: 0
channel : https://repo.anaconda.com/pkgs/main/osx-64
size : 155 KB
arch : None
constrains : ()
license : MIT
license_family: MIT
md5 : 603417ae48ed5fa80d809dfb91c47f55
platform : None
subdir : osx-64
timestamp : 1505923681524
url : https://repo.anaconda.com/pkgs/main/osx-64/urllib3-1.22-py36h68b9469_0.tar.bz2
dependencies:
certifi
cryptography >=1.3.4
idna >=2.0.0
pyopenssl >=0.14
pysocks >=1.5.6,<2.0,!=1.5.7
python >=3.6,<3.7.0a0
I uninstalled cryptography and idna using pip uninstall, but the conflict doesn't go- i get the same error when I conda install -c davidbgonzalez awsebcli.
What's wrong here?
It might be that you already have a urllib3 in your conda lib directory. Have you tried uninstalling urlliub3 prior to attempting to install awsebcli?
At any rate, installation of the awsebcli using conda is not officially supported. Furthermore, conda install -c davidbgonzalez awsebcli installs a version of the awsebcli almost 2 years old.
I tried a pip install awsebcli- and it installed properly, but I'm not able to locate the executable and thus not sure how to include it ...
Did you install it as sudo? If so, it would make it non-readable to your user (as it is not in your path). This is a common pitfall. I recommend using virtualenv with pip for the sanest experience. Let me know if this works.

Conda cannot install pydot-ng with python3 (Unsatisfiable error)

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

Categories

Resources