-
大小: 20.25MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-06-17
- 语言: Python
- 标签: python 理想 pip python2.7.15
资源简介
资料只是讲了一种思路,可以自己根据自己的需要修改,python版本用的是2.7.15,可以根据实际项目选取适当的python版本。
代码片段和文件信息
#!/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 (version 18.1).
#
# 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._internal
from pip._internal.commands.install import InstallCommand
from pip._internal.req.constructors import install_req_from_line
# Wrapper to provide default certi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-20 16:49 autoenv\
目录 0 2018-12-20 16:47 autoenv\whl\
目录 0 2018-12-20 16:47 autoenv\whl\pip\
文件 1323545 2018-12-20 16:49 autoenv\whl\pip\pip-18.1-py2.py3-none-any.whl
目录 0 2018-12-20 16:50 __MACOSX\
目录 0 2018-12-20 16:50 __MACOSX\autoenv\
目录 0 2018-12-20 16:50 __MACOSX\autoenv\whl\
目录 0 2018-12-20 16:50 __MACOSX\autoenv\whl\pip\
文件 179 2018-12-20 16:49 __MACOSX\autoenv\whl\pip\._pip-18.1-py2.py3-none-any.whl
文件 21454 2018-12-20 16:49 autoenv\whl\pip\wheel-0.32.3-py2.py3-none-any.whl
文件 179 2018-12-20 16:49 __MACOSX\autoenv\whl\pip\._wheel-0.32.3-py2.py3-none-any.whl
文件 573103 2018-12-20 16:49 autoenv\whl\pip\setuptools-40.6.3-py2.py3-none-any.whl
文件 179 2018-12-20 16:49 __MACOSX\autoenv\whl\pip\._setuptools-40.6.3-py2.py3-none-any.whl
文件 179 2018-12-20 16:47 __MACOSX\autoenv\whl\._pip
文件 179 2018-12-20 16:47 __MACOSX\autoenv\._whl
文件 1661676 2018-12-20 16:49 autoenv\get-pip.py
文件 179 2018-12-20 16:49 __MACOSX\autoenv\._get-pip.py
文件 571091 2018-12-20 16:49 autoenv\zlib-1.2.8.tar.gz
文件 179 2018-12-20 16:49 __MACOSX\autoenv\._zlib-1.2.8.tar.gz
文件 17496336 2018-12-20 16:49 autoenv\Python-2.7.15.tgz
文件 179 2018-12-20 16:49 __MACOSX\autoenv\._Python-2.7.15.tgz
文件 225 2018-12-20 16:49 autoenv\autoenv.sh
文件 235 2018-12-20 16:49 __MACOSX\autoenv\._autoenv.sh
文件 179 2018-12-20 16:49 __MACOSX\._autoenv
相关资源
- Automate the Boring Stuff with Python 无水印
- 图灵书籍(流畅的Python.pdf+Python基础教
- python脚本运行环境.zip
- Python数据科学手册(高清完整版2018版
- Python编程:从入门到精通配套资源.
- dlib_face_recognition_resnet_model_v1.dat人脸识
- python 3.7.0 for Windows
- 面向ArcGIS的Python脚本编程.pdf
- 廖雪峰大神python教程1-3及新版全套P
- Python数据科学手册:Python Data Science
- python 3.6.4最新中文手册pdf和英文手册
- 深入浅出Python457页中文完整版.pdf
- opencv_python-4.1.0-cp35-cp35m-win_amd64.whl
- 手写数字识别:Python+BP神经网络+PYQ
- Effective Python 编写高质量Python代码的
- 《Deep Learning With Python》中文版+英文版
- Python语言程序设计基础_嵩天_第2版
- ABAQUSGUI程序开发指南PYTHON语言_139333
- 美多商城的Docker及FastDFS文件
- python 3.6 geopandas依赖包
- Python机器学习及实践高清
- python和Arcpy文档
- python3.7.2下调用gdal进行shapefile操作
- Fluent Python. pdf 中文版 版
- Python Data Science Handbook
- facebook开源项目prophet python模块fbprop
- Introduction to Machine Learning with Python 原
- MPU-6050使用Python上位机监控可视化实时
- 编写高质量代码 改善Python程序的91个
- Python数据科学手册.rar
评论
共有 条评论