I am trying to port some code from 2.7 to 3.6, and I am having problems with the installing package configparser for py-3.6 in anaconda.
When I execute the following command, I get an error:
$ conda install -c anaconda configparser
UnsatisfiableError: The following specifications were found to be in conflict:
- configparser -> python[version='>=2.7,<2.8.0a0']
- python=3.6
The dependencies also gives me the same information:
conda info configparser
configparser 3.5.0 py27h5117587_0
---------------------------------
dependencies:
python >=2.7,<2.8.0a0
However, question-14087598 says the package is available in py-3.6. How should I install this package in anaconda?
(One solution in the above link suggests to install through the python program itself, but I would like to install through anaconda.)
The package configparser
is a backport of a Python 3.5 standard module to older versions of Python. Unfortunately, it appears that the Anaconda version of this package is not packaged for Python 3.
However, you are using Python 3.6, so you can simply use the configparser
which comes preinstalled with Python instead of installing anything.
It's possible that the source code you are attempting to port contains a line like this (which will fail if the backport is not installed):
from backports import configparser
You can probably replace that line with the following:
import configparser
There are minor differences between the 3.5-compatible version installed in the backport and the version provided by 3.6, but the 3.6 version should be backwards compatible for most reasonable use cases. The main purpose of the from backports
form is to enable developing 2.x-compatible code in a 3.x-only environment without accidentally using new features that don't exist in the backport.