0

I Want install obfsproxy using pip at centos7

command: pip install --upgrade obfsproxy output:

[root@ip231 ~]# pip install --upgrade obfsproxy
Collecting obfsproxy
  Using cached https://files.pythonhosted.org/packages/f6/25/ca704db7b8d0e462cd942ffad59674e4b2d33057c2587eab8a6b846cee1d/obfsproxy-0.2.13.tar.gz
Collecting setuptools (from obfsproxy)
  Using cached https://files.pythonhosted.org/packages/25/f3/d68c20919bc774c6cb127f1762f2f2f999d700a58198556e883dd3700e58/setuptools-67.6.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "setuptools/__init__.py", line 100
        dist.announce(f"\n{msg}\n")
                                 ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-LKH0wq/setuptools/
You are using pip version 8.1.2, however version 23.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

pip Version:

[root@ip231 ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

python Version:

[root@ip231 ~]# python
Python 2.7.5 (default, Jun 28 2022, 15:30:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

pip install --upgrade pip output:

https://files.pythonhosted.org/packages/6b/8b/0b16094553ecc680e43ded8f920c3873b01b1da79a54274c98f08cb29fca/pip-23.0.1.tar.gz
[root@ip231 ~]# python -c 'import setuptools; print(setuptools.__version__)'
0.9.8
[root@ip231 ~]# python -c 'import distutils; print(distutils.__version__)'
2.7.5
[root@ip231 ~]# python -m pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
yxz
  • 112
  • 9

1 Answers1

0

You are using Python 2.7 and f-strings are available on Python >= 3.6.

Since the error comes from the package setuptools, you will need to downgrade setuptools to the last version compatible with Python 2.7, ie setuptools==44.1.1:

pip install -U "setuptools==44.1.1"

See the setuptools Pypi page for more info.

vvvvv
  • 25,404
  • 19
  • 49
  • 81