在使用 box bento/centos-7 的新 Vagrant VM 上,以下命令破坏了我的 pip 安装:
yum update
yum install epel-release -y
yum install python-pip -y
/usr/bin/pip2 install --upgrade pip setuptools pyOpenSSL psycopg2-binary lxml
Run Code Online (Sandbox Code Playgroud)
这最终失败了
Downloading https://files.pythonhosted.org/packages/84/48/5c99d8770fd0a9eb0f82654c3294aad6d0ba9f8600638c2e2ad74f2c5d52/setuptools-52.0.0.tar.gz (2.1MB)
100% |????????????????????????????????| 2.1MB 821kB/s
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 16, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 1367
raise SyntaxError(e) from e
^
SyntaxError: invalid …Run Code Online (Sandbox Code Playgroud) 我开始使用 bitbucket CI 制作应用程序,我正在使用以下步骤来部署应用程序,但安装 pip 的步骤失败了。
script:
- apt-get update
- apt-get install -y python-dev
- curl -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
... and a few more steps
Run Code Online (Sandbox Code Playgroud)
不知道为什么,但python get-pip.py步骤失败并出现以下错误。
Traceback (most recent call last):
File "get-pip.py", line 24226, in <module>
main()
File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpUgc5ng/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
直到昨天,这一切正常。不知道为什么这现在不起作用。
我认为这可能是因为 Windows,但我检查了运行 linux 的本地机器,但这些步骤但它们工作正常。
我想使用与 python 2.7(但不是 3.8)兼容的 python 脚本
我需要 pip 才能使脚本正常工作,但看起来我无法再安装 pip 了?我尝试使用 get-pip.py ,但它不起作用:
user@DESKTOP-J9T7UBF
$ get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
c:\users\user\appdata\local\temp\tmp2kztqk\pip.zip\pip\_vendor\urllib3\util\ssl_.py:387: SNIMissingWarning: An HTTPS request has been made, …Run Code Online (Sandbox Code Playgroud)