0

After upgrading pip on python3.5 I am getting the message

File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57 sys.stderr.write(f"ERROR: {exc}")

I tried the solution in pip: sys.stderr.write(f"ERROR: {exc}") with Python 3.5

However when I try sudo curl -fsSL https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5

I get

/usr/local/lib/python3.5/dist-packages/_distutils_hack/__init__.py:18: 
UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.`
  `"Distutils was imported before Setuptools, but importing Setuptools "
/usr/local/lib/python3.5/dist-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")

 Traceback (most recent call last):
  File "<stdin>", line 23974, in <module>
  File "<stdin>", line 199, in main
  File "<stdin>", line 121, in bootstrap
  File "/usr/local/lib/python3.5/dist-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/usr/local/lib/python3.5/dist-packages/_distutils_hack/override.py", line 1, in 
 <module>
    __import__('_distutils_hack').do_override()
  File "/usr/local/lib/python3.5/dist-packages/_distutils_hack/__init__.py", line 72, in do_override
     ensure_local_distutils()
  File "/usr/local/lib/python3.5/dist-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.5/distutils/core.py ```

Any ideas?

jo3rn
  • 1,291
  • 1
  • 11
  • 28
  • Side note: when you run `sudo curl … | python3.5` only `curl` is being run with root privileges, not Python. Most probably you want to it the other way around: `curl … | sudo python3.5` – phd Apr 19 '22 at 11:00

0 Answers0