I have found the following workaround on Ubuntu 16.04 Xenial

Do not install setuptools on virtualenv creation:

`virtualenv -p /usr/bin/python3 venv/py3 --verbose --no-setuptools`

Install a supported setuptools version after virtualenv creation and
activation:

`python3 -m pip install --upgrade 'setuptools; python_version >= "3.6"'
'setuptools<51.3.0; python_version < "3.6" and python_version >= "3.0"'`

> Ignoring setuptools: markers 'python_version >= "3.6"' don't match your 
> environment
> Ignoring setuptools: markers 'python_version < "3.0"' don't match your 
> environment
> Collecting setuptools<51.3.0
>   Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
> Installing collected packages: setuptools
> Successfully installed setuptools-50.3.2

or by adding the following to your requirements.txt

```
setuptools; python_version >= "3.6"
setuptools<51.3.0; python_version < "3.6" and python_version >= "3.0"
```

This results in `python3 -m pip list`:

> pip        20.3.3
> setuptools 50.3.2
> wheel      0.36.2

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1912248

Title:
  virtualenv on xenial: easy_install syntax error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1912248/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to