【python bug修復】——Script file ‘D:\softwares_install\Anaconda3\envs\PartTimes\Scripts\pip-scrip

目錄

1、問題描述

2、問題解決

1)下載pip安裝腳本

2) 運行安裝pip腳本

3) 下載庫


1、問題描述

利用pip命令進行庫的安裝時,突然出現這個問題,之前使用還好好的

Script file 'D:\softwares_install\Anaconda3\envs\PartTimes\Scripts\pip-scrip

出現這個問題其實就是pip工具出現了問題,因此需要進行pip工具重新安裝

2、問題解決

1)下載pip安裝腳本

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py # 下載pip安裝腳本?

運行后會自動下載得到一個get-pip.py文件

get-pip.py文件部分內容如下:

#!/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 22.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 generated using
# `scripts/generate.py` in https://github.com/pypa/get-pip.import systhis_python = sys.version_info[:2]
min_version = (3, 7)
if this_python < min_version:message_parts = ["This script does not work on Python {}.{}".format(*this_python),"The minimum supported Python version is {}.{}.".format(*min_version),"Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(*this_python),]print("ERROR: " + " ".join(message_parts))sys.exit(1)import os.path
import pkgutil
import shutil
import tempfile
import argparse
import importlib
from base64 import b85decodedef include_setuptools(args):"""Install setuptools only if absent and not excluded."""cli = not args.no_setuptoolsenv = not os.environ.get("PIP_NO_SETUPTOOLS")absent = not importlib.util.find_spec("setuptools")return cli and env and absentdef include_wheel(args):"""Install wheel only if absent and not excluded."""cli = not args.no_wheelenv = not os.environ.get("PIP_NO_WHEEL")absent = not importlib.util.find_spec("wheel")return cli and env and absentdef determine_pip_install_arguments():pre_parser = argparse.ArgumentParser()pre_parser.add_argument("--no-setuptools", action="store_true")pre_parser.add_argument("--no-wheel", action="store_true")pre, args = pre_parser.parse_known_args()args.append("pip")if include_setuptools(pre):args.append("setuptools")if include_wheel(pre):args.append("wheel")return ["install", "--upgrade", "--force-reinstall"] + argsdef monkeypatch_for_cert(tmpdir):"""Patches `pip install` to provide default certificate with the lowest priority.This ensures that the bundled certificates are used unless the user specifies acustom cert via any of pip's option passing mechanisms (config, env-var, CLI).A monkeypatch is the easiest way to achieve this, without messing too much withthe rest of pip's internals."""from pip._internal.commands.install import InstallCommand# We want to be using the internal certificates.cert_path = os.path.join(tmpdir, "cacert.pem")with open(cert_path, "wb") as cert:cert.write(pkgutil.get_data("pip._vendor.certifi", "cacert.pem"))install_parse_args = InstallCommand.parse_argsdef cert_parse_args(self, args):if not self.parser.get_default_values().cert:# There are no user provided cert -- force use of bundled certself.parser.defaults["cert"] = cert_path  # calculated abovereturn install_parse_args(self, args)InstallCommand.parse_args = cert_parse_argsdef bootstrap(tmpdir):monkeypatch_for_cert(tmpdir)# Execute the included pip and use it to install the latest pip and# setuptools from PyPIfrom pip._internal.cli.main import main as pip_entry_pointargs = determine_pip_install_arguments()sys.exit(pip_entry_point(args))def main():tmpdir = Nonetry:# Create a temporary working directorytmpdir = tempfile.mkdtemp()# Unpack the zipfile into the temporary directorypip_zip = os.path.join(tmpdir, "pip.zip")with open(pip_zip, "wb") as fp:fp.write(b85decode(DATA.replace(b"\n", b"")))# Add the zipfile to sys.path so that we can import itsys.path.insert(0, pip_zip)# Run the bootstrapbootstrap(tmpdir=tmpdir)finally:# Clean up our temporary working directoryif tmpdir:shutil.rmtree(tmpdir, ignore_errors=True)DATA = b"""此處省略一萬個字"""
if __name__ == "__main__":main()

2) 運行安裝pip腳本

python get-pip.py # 運行安裝腳本安裝pip。

運行上述命令行,pip就安裝好了可以利用pip命令進行庫的下載了?

3) 下載庫

pip install 庫名

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/255391.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/255391.shtml
英文地址,請注明出處:http://en.pswp.cn/news/255391.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

項目中的那些事---下載pdf文件

最近做了一個下載pdf文檔的需求&#xff0c;本以為使用HTML5中<a>標簽的屬性download就能簡單搞定&#xff0c;不料IE竟然不支持這一簡單粗暴的H5新特性&#xff0c;而是直接在網頁中打開&#xff0c; 于是各種搜索之后得出以下結論&#xff1a;IE中下載文檔時&#xff0…

MySQL日志分類及性能分析你應該知道的知識

為什么80%的碼農都做不了架構師&#xff1f;>>> MySQL日志記錄了MySQL數據庫日常操作和錯誤信息&#xff0c;MySQL總共有四種類型的日志&#xff0c;通過分析這些日志可以查詢到MySQL的運行情況、用戶操作、錯誤信息等&#xff0c;可以為MySQL的管理和優化提供必要…

利用三個點(trsf)來實現各種規則圖形的實現

在Val3,是使用trsf(x,y,z,rx,ry,rz)來實現三維空間點的位置與方向。 其中第一點和第二點位置很重要&#xff0c;第三點是用來確定方向。根據這三個點先確定一個用戶坐標系。 在這個坐標系中&#xff0c;實現圓&#xff0c;三角形&#xff0c;矩形&#xff0c;腰圓&#xff0c;正…

android基礎組件----Button的使用

按鈕由文本或圖標&#xff08;或文本和一個圖標&#xff09;組成&#xff0c;當用戶觸摸到它時&#xff0c;會發生一些動作。今天我們開始Button的學習。少年的愛情永遠不夠用&#xff0c;一杯酒足以了卻一件心事。 Button的簡要說明 根據你是否想要一個帶有文本的按鈕&#xf…

@Repository、@Service、@Controller 和 @Component

Repository 、Service 、 Controller 、Component 這四個Spring注解 ,用于把加了注解的 類 加入到Spring 容器中管理&#xff0c;節省了xml 的繁重的配置&#xff0c;盡管如此xml 同樣可以實現&#xff08;一般建議先搞懂xml&#xff09;。 Repository Repository注解便屬于最先…

【pyqt5學習】——QTextEdit控件學習:獲取文本、添加文本

目錄 1、QTextEdit控件介紹 2、QTextEdit控件添加文本、添加HTML格式 3、QTextEdit控件獲取文本、獲取HTML格式文本 4、案例 1&#xff09;完整代碼 2&#xff09;效果 1、QTextEdit控件介紹 QTextEdit控件是一個支持多行輸入的輸入框&#xff0c;支持HTML進行格式的設置 2…

空間變化

空間變化 第一種&#xff1a;圓 第二種: 矩形 第三種&#xff1a;正五邊形 第四種:正六邊形 第五種&#xff1a;腰圓 算法&#xff1a; 在規則圖形&#xff08;不包括圓心-直徑法&#xff09;中&#xff0c;等于或者超過三個點。一般的&#xff0c;利用p1,p2,p3來建立一個用戶…

【pyqt5學習】——QAbstractButton學習(普通按鈕QPushButton、工具按鈕QToolButton、單選按鈕QRadioButton、復選框按鈕QCheckBox)

目錄 1、按鈕介紹 2、普通按鈕QPushButton學習 1&#xff09;特殊模式——開關按鈕&#xff08;toggle&#xff09; ①將按鈕設置為可選擇的 ②將按鈕按下 判斷按鈕是否被按下 isChecked() 2&#xff09;給按鈕設置前置圖標setIcon() ?編輯 3&#xff09;按鈕信號 4)完…

java 企業 網站源碼 模版 屏幕自適應 有前后臺 springmvc SSM 生成靜態化

前臺&#xff1a; 支持四套模版&#xff0c; 可以在后臺切換點擊&#xff1a;獲取地址QQ 313596790官網 http://www.fhadmin.org/系統介紹&#xff1a;1.網站后臺采用主流的 SSM 框架 jsp JSTL&#xff0c;網站后臺采用freemaker靜態化模版引擎生成html2.因為是生成的html&…

挖財后端架構簡介

挖財后端技術用的主要是比較大眾的東西&#xff0c;Web容器用Tomcat&#xff0c;框架主要是Spring MVC&#xff0c;也有少量的Play&#xff0c;中間服務層是Dubbo&#xff0c;微容器用Spring Boot&#xff0c;服務注冊這一塊是用ZooKeeper&#xff0c;核心業務開發方式還是圍繞…

【pyqt5學習】——QcomboBox學習

目錄 1、添加條目&#xff1a; 1)逐一添加 2&#xff09;批量添加 3&#xff09;獲取當前選中的索引 4&#xff09;獲取當前選中文本 5&#xff09;根據索引獲取文本 6&#xff09;統計條目總數 7&#xff09;信號——當前選中的索引發生改變currentIndexChanged() 2、…

vSphere Client 編輯虛擬機屬性的問題

vSphere Client 編輯虛擬機屬性的問題 編輯虛擬機屬性的時候&#xff0c; 出現&#xff1a; vpxclient.vmconfig.cpuid 初始值設置異常之類的&#xff0c;重置了&#xff0c; 并將注冊表中的所有vmvare 相關鍵值刪除了&#xff0c; 還是一樣的。。 后面參照https://kb.vmware.c…

Val編程-系統架構

利用Val可以編寫相對大型軟件。 界面書寫&#xff0c;運動軌跡規劃&#xff0c;外部通訊&#xff0c;進程交互&#xff0c;文本讀寫.... GlobalData可以利用一個庫來作為一個公用庫&#xff0c;實現各個庫的數據交互。 PublicFunc書寫基本的通用函數來作為基本函數&#xff0c;…

poj 1256 Anagram—next_permutation的神奇應用

題意&#xff1a;給你一條字符串&#xff0c;讓你輸出字符串中字符的全排列&#xff0c;輸出的順序要按它給的奇葩的字典序。 題解&#xff1a;要輸出全排列&#xff0c;暴力dfs可以過&#xff0c;但要注意題目的字典序以及相同字符的情況。如果用next_permutation()處理可以簡…

【pyqt5學習】—— 滑動條Qslider、計數器QSpinBox學習

目錄 1、滑動條QSlider 1)常用屬性 2&#xff09;實例——利用滑動條來實現字體大小的修改 ?編輯 2、計數器QSpinBox 1&#xff09;屬性方法 2&#xff09;實例 1、滑動條QSlider 1)常用屬性 self.slider QSlider(Qt.Horizontal)# 設置最小值self.slider.setMinimum(2)…

shell常用命令之curl: -w,–write-out參數詳解

顧名思義&#xff0c;write-out的作用就是輸出點什么。curl的-w參數用于在一次完整且成功的操作后輸出指定格式的內容到標準輸出。 輸出格式由普通字符串和任意數量的變量組成&#xff0c;輸出變量需要按照%{variable_name}的格式&#xff0c;如果需要輸出%&#xff0c;double一…

Val編程-速度因子

機械手臂在一個三個基本指令&#xff08;movel,movej,movec&#xff09;指令中有下面基本參數進行配置。 1. Frame toolField; Tcp的值2. Frame frameField;用戶坐標系的值3. MoveType absRelField;絕對運動與相對運動4. Config configField;姿態5. BlendType blendTypeField;倒…

Node.js學習之路24——Express框架的app對象

1.express() 基于Node.js平臺&#xff0c;快速、開放、極簡的web開發框架。創建一個Express應用.express()是一個由express模塊導出的入口top-level函數.const express require(express); let app express(); 1.1 靜態資源管理 express.static(root, [options]) express.stat…

【pyqt5學習】——對話框QDialog學習(QMessageBox、QColorDialog、QFIleDialog、QFontDialog、QInputDialog)

目錄 1、對話框QDialog類別 2、通用對話框 ?編輯 3、消息對話框QMessageBox() 1&#xff09;消息對話框QMessageBox類型 2&#xff09;案例 ?編輯 4、輸入對話框QInputDialog 1) 類型 2&#xff09;案例 5、字體格式對話框QFontDialog 6、顏色對話框QColorDialog 1&…

使用 Mesos 管理虛擬機

摘要 為了滿足渲染、基因測序等計算密集型服務的需求&#xff0c;UCloud 推出了“計算工廠”產品&#xff0c;讓用戶可以快速創建大量的計算資源&#xff08;虛擬機&#xff09;。該產品的背后&#xff0c;是一套基于 Mesos 的計算資源管理系統。本文簡要介紹該系統的結構、Mes…