Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setuptools 45 installed on Python 2 with anaconda #2004

Open
dbl001 opened this issue Feb 17, 2020 · 3 comments
Open

setuptools 45 installed on Python 2 with anaconda #2004

dbl001 opened this issue Feb 17, 2020 · 3 comments
Labels

Comments

@dbl001
Copy link

dbl001 commented Feb 17, 2020

I am running Anaconda Python on OS X as well as Ubuntu.

My base Ananaconda environment on OS X is is 2.7.
How can I upgrade it?
When I try to save my environments to .yaml file I get python 2.7 errors.

$ conda -V
conda 4.8.2

 $ pip -V
pip 20.0.2 from /Users/davidlaxer/anaconda/lib/python2.7/site-packages/pip (python 2.7)

$ conda list setuptools
# packages in environment at /Users/davidlaxer/anaconda:
#
# Name                    Version                   Build  Channel
setuptools                45.0.0                   py27_0    conda-forge

$ conda env export > environment.yaml
/Users/davidlaxer/anaconda/lib/python2.7/site-packages/pkg_resources/py2_warn.py:19: UserWarning: ************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release. Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn("*" * 60 + msg + "*" * 60)

On Ubuntu 16.06 LTS:

(base) ubuntu@ip-10-0-1-71:~$ conda -V
conda 4.8.2
(base) ubuntu@ip-10-0-1-71:~$ pip -V
/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
pip 20.0.2 from /home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/pip (python 2.7)
(base) ubuntu@ip-10-0-1-71:~$ conda list setuptools
# packages in environment at /home/ubuntu/anaconda2:
#
# Name                    Version                   Build  Channel
setuptools                41.4.0                   py27_0    anaconda
(base) ubuntu@ip-10-0-1-71:~$ conda env export > environment.yaml
/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
NVIDIA: no NVIDIA devices found
Traceback (most recent call last):
  File "/home/ubuntu/anaconda2/bin/conda-env", line 6, in <module>
    from conda_env.cli.main import main
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/conda_env/cli/main.py", line 44, in <module>
    from . import main_create
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/conda_env/cli/main_create.py", line 17, in <module>
    from .. import exceptions, specs
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/conda_env/specs/__init__.py", line 7, in <module>
    from .binstar import BinstarSpec
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/conda_env/specs/binstar.py", line 11, in <module>
    from binstar_client import errors
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/binstar_client/__init__.py", line 17, in <module>
    from .utils import compute_hash, jencode, pv
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/binstar_client/utils/__init__.py", line 17, in <module>
    from .config import (get_server_api, dirs, load_token, store_token,
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/binstar_client/utils/config.py", line 22, in <module>
    from .yaml import yaml_load, yaml_dump
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/binstar_client/utils/yaml.py", line 4, in <module>
    from yaml import safe_load, safe_dump, SafeLoader
  File "/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/yaml/__init__.py", line 8, in <module>
    from .loader import *
  File "/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/yaml/loader.py", line 4, in <module>
    from .reader import *
  File "/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/yaml/reader.py", line 45, in <module>
    class Reader(object):
  File "/home/ubuntu/anaconda2/envs/ai/lib/python3.6/site-packages/yaml/reader.py", line 137, in Reader
    NON_PRINTABLE = re.compile('[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uD7FF\uE000-\uFFFD\U00010000-\U0010ffff]')
  File "/home/ubuntu/anaconda2/lib/python2.7/re.py", line 194, in compile
    return _compile(pattern, flags)
  File "/home/ubuntu/anaconda2/lib/python2.7/re.py", line 251, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range
@pganssle pganssle changed the title You are running Setuptools on Python 2, which is no longer supported and >>> SETUPTOOLS WILL STOP WORKING <<< setuptools 45 installed on Python 2 Feb 19, 2020
@pganssle pganssle changed the title setuptools 45 installed on Python 2 setuptools 45 installed on Python 2 with anaconda Feb 19, 2020
@pganssle
Copy link
Member

I can't really tell what's going on here, and it's very hard to do so without a clean reproducer. It seems like in some cases you're getting setuptools 45 installed on Python 2 and in other cases you are getting the Python 2 warning on Python 3?

The first one might be a duplicate of #1458, and there's some anaconda-specific thing that's ignoring the python_requires metadata. The second one might be more interesting.

@dbl001
Copy link
Author

dbl001 commented Feb 19, 2020 via email

@jaraco
Copy link
Member

jaraco commented May 10, 2020

Is there a way to upgrade [my Anaconda base environment] to 3.7?

This team is not familiar with Anaconda, so I'd reach out to that team for guidance on that.

On your Ubuntu system, the fact that you're getting the py2 warning for a file in the python3.6 source tree suggests to me that something (Anaconda maybe) has caused Python 2 to link to your Python 3 site packages. You'll want to inspect sys.path and possible do some debugging with python -v or tracing of import site to determine where or how that's happening. Also check that the environment variable PYTHONPATH isn't somehow implicated.

For your OS X environment, where you have Python 2, it may be the case that all you need to do is use conda to downgrade to setuptools<45.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants