资源简介
自己在网上找了很久,因为自己早期安装的是2.7.6的Python,想安装pip就是安装不上,找了很多都是支持3.x的后来终于找到了 给大家分享下
代码片段和文件信息
#!/usr/bin/env python
#
# Hi There!
# You may be wondering what this giant blob of binary data here is you might
# even be worried that we‘re up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file this zip file contains
# an entire copy of pip.
#
# Pip is a thing that installs packages pip itself is a package that someone
# might want to install especially if they‘re looking to run this get-pip.py
# script. Pip has a lot of code to deal with the security of installing
# packages various edge cases on various platforms and other such sort of
# “tribal knowledge“ that has been encoded in its code base. Because of this
# we basically include an entire copy of pip inside this blob. We do this
# because the alternatives are attempt to implement a “minipip“ that probably
# doesn‘t do things correctly and has weird edge cases or compress pip itself
# down into a single file.
#
# If you‘re wondering how this is created it is using an invoke task located
# in tasks/generate.py called “installer“. It can be invoked by using
# ‘‘invoke generate.installer‘‘.
import os.path
import pkgutil
import shutil
import sys
import struct
import tempfile
# Useful for very coarse version differentiation.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
iterbytes = iter
else:
def iterbytes(buf):
return (ord(byte) for byte in buf)
try:
from base64 import b85decode
except ImportError:
_b85alphabet = (b“0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ“
b“abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_‘{|}~“)
def b85decode(b):
_b85dec = [None] * 256
for i c in enumerate(iterbytes(_b85alphabet)):
_b85dec[c] = i
padding = (-len(b)) % 5
b = b + b‘~‘ * padding
out = []
packI = struct.Struct(‘!I‘).pack
for i in range(0 len(b) 5):
chunk = b[i:i + 5]
acc = 0
try:
for c in iterbytes(chunk):
acc = acc * 85 + _b85dec[c]
except TypeError:
for j c in enumerate(iterbytes(chunk)):
if _b85dec[c] is None:
raise ValueError(
‘bad base85 character at position %d‘ % (i + j)
)
raise
try:
out.append(packI(acc))
except struct.error:
raise ValueError(‘base85 overflow in hunk starting at byte %d‘
% i)
result = b‘‘.join(out)
if padding:
result = result[:-padding]
return result
def bootstrap(tmpdir=None):
# Import pip so we can use it to install pip and maybe setuptools too
import pip
from pip.commands.install import InstallCommand
from pip.req import InstallRequirement
# Wrapper to provide default certificate with the lowest priority
class CertInstallCommand(
相关资源
- TBCNN 源码
- 车牌号码识别python+opencv
- python for information
- Ubuntu18.04LTS下安装 Caffe-GPU版本及 Ana
- 精通Python设计模式.pdf 清晰中文完整版
- learn-python-the-hard-way中文版
- Python3官方手册中文版
- XGBoost with Python (book + complete code fo
- 基于Python的微信自动回复机器人
- 500 line or less最新版
- Python Odoo企业级开发实战
- python学生管理系统.zip
- 根据关键字爬虫谷歌、百度、必应图
- PCA 算法实验代码python
- Text.Analytics.with.Python
- python版植物大战僵尸源码
- python的计量经济学
- 人体姿态检测
- Python for Data Analysis 2nd Edition 英文高清
- faster rcnn(python+caffe)源代码
- python-2.7.16中文文档 chm版
- Python DBC LIB
- 基于python3 与openCV的面部表情识别
- Python程序设计与算法基础教程
- 机器学习实战 Python实现
- Python for ProbabilityStatisticsand Machine Le
- 《Rapid GUI Programming with Python and Qt》
- pandas-0.9.0.win32-py2.7.exe
- 安全帽检测detect.7z
- python语言程序设计. 梁勇. 李娜译-习题
评论
共有 条评论