Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify Python 2.7+ and Python 3.xx (any) in ``setup.py''

My "setup.py" currently includes the following statement:

setup(...
    classifiers = [
            ...
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.1",
            "Programming Language :: Python :: 3.2",
            "Programming Language :: Python :: 3.3",
            "Programming Language :: Python :: 3.4",
            "Programming Language :: Python :: 3.5",
            "Programming Language :: Python :: 3.6",
            "Programming Language :: Python",
            ...
            ],
    ...
    )

Is there a way for me to specify "any Python 3, from 3.0 upwards", without explicitly enumerating all the existing and future Pythons?

The reason I ask this is because, even though the general "Programming Language :: Python :: 3" is specified in the above, an Anaconda install fails with:

Fetching package metadata ......... 
Solving package specifications: .... 
UnsatisfiableError: The following specifications were found to be in conflict:  
- dendropy 
- python 3.5
* Use "conda info <package>" to see the dependencies for each package

The pip install works fine.

Thanks!

like image 742
Jeet Avatar asked Oct 17 '22 19:10

Jeet


1 Answers

The classifiers are just hints, neither conda install or pip install actually looks at them when you install a package. These hints are for the people searching for a package or looking at a package. If a package supports all python 3 versions it doesn't matter if you list them explicitly or just as "Programming Language :: Python :: 3" I guess most visitors will know what's meant - it's more a matter of personal preference of the author (and the number of already chosen classifiers).

However when you install the package with conda (even if it's pure python) it has to built against the python and OS version you're using. In your case you try to install from the ericmjl conda channel. This channel contains the python 3.5 version but only for OSX, the binaries for linux are python 3.4 only.

You could install it from PyPI into your conda environment by using pip: pip install dendropy (make sure you use the pip that's installed in your conda environment).

like image 199
MSeifert Avatar answered Oct 21 '22 07:10

MSeifert