我正在使用 CentOS 7 操作系统。
我在这台机器上安装了 python3.6。pip3
是最新版本 21。
之后我像这样安装了 obfsproxy:
要使用 obfsproxy,您需要 Python (>= 2.7) 和 pip。
pip3 install pathlib
pip3 install pyopenssl
pip3 install Twisted
pip3 install obfsproxy
安装路径如下:
/usr/local/lib/python3.6/site-packages/obfsproxy-0.2.13-py3.6.egg-info
/usr/local/lib/python3.6/site-packages/obfsproxy
/usr/local/lib/python3.6/site-packages/obfsproxy/pyobfsproxy.py
/usr/local/bin/obfsproxy
现在运行 obfsproxy 命令后我收到此错误:
Traceback (most recent call last):
File "/usr/local/bin/obfsproxy", line 11, in <module>
load_entry_point('obfsproxy==0.2.13', 'console_scripts', 'obfsproxy')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python3.6/site-packages/obfsproxy/pyobfsproxy.py", line 183
except ValueError, err:
^
SyntaxError: invalid syntax
[root@blobloblo ~]# obfsproxysite-packages/pkg_resources/__init__.py", line 476, in load_entry_point
哪个版本的 Python 适合这个脚本,我该如何修复这个错误?
我尝试了一些较旧的 Python 版本。
购买手动安装有一些错误,最好从默认存储库安装 Python3。
为了安装 Python3,我这样做了:
centos 已全面更新。
sudo yum install -y epel-release
sudo yum install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
sudo yum -y groupinstall "Development Tools"
gcc --version
openssl version
openssl version -d
sudo yum install -y openssl-devel libyaml-devel libffi-devel bzip2-devel
sudo yum install -y make automake gcc glibc
sudo yum install -y gcc
python -V
python --version
python2 -V
python3 -V
sudo yum install python3
python3 -m pip install --upgrade pip