首页 > 系统相关 >Linux修改python源

Linux修改python源

时间:2023-06-26 15:57:32浏览次数:48  
标签:None python selenium URL module 修改 connect Linux simple

在运行pip install selenium或者安装其他三方库的时候遇到如下报错:

Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/selenium/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/selenium/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/selenium/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement selenium (from versions: none)
ERROR: No matching distribution found for selenium
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
WARNING: There was an error checking the latest version of pip.

切换到阿里云

pip3 config set global.index-url http://mirrors.aliyun.com/pypi/simple/

就可以了

或者到根目录下~/.pip/pip.conf,没有就自己创建

pip.conf文件内容如下:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host = mirrors.aliyun.com

标签:None,python,selenium,URL,module,修改,connect,Linux,simple
From: https://www.cnblogs.com/finnwu/p/17505810.html

相关文章

  • makefile只编译修改过的文件
    本文演示配置makefile,检测修改的代码才编译,提升编译效率。1.测试代码$tree.├──app.c├──lib│├──module2.c│└──module2.h├──makefile├──module1.c└──module1.happ.c#include<stdio.h>#include"app.h"#include"......
  • linux 安装 mysql 的 glibc 包
    下载mysql:http://downloads.mysql.com/archives.php选择一个mysql的版本,之后一定要看好,下glibc的。如:mysql-5.0.90-linux-i686-glibc23.tar.gz本例中下载到了/media目录下,这个不是好习惯... ▲安装mysql:下面是linux命令:$sudogroupaddmysql:$sudouseradd-gmysql......
  • Python爬虫完整代码模版
    以下是一个基本的Python爬虫代码模板,可以根据需要进行修改:importrequestsfrombs4importBeautifulSoup#设置请求头,模拟浏览器访问headers={'User-Agent':'Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/58.0.3029.110......
  • 您需要配置好的 Python 2 SDK 来渲染 Epydoc docstring
    今天给代码写注释,写完以后,鼠标放在方法上注释显示异常。我发现是因为我注释的格式不对。把@改成:后问题解决......
  • python下载与安装
    python下载与安装一、下载官网下载地址:https://www.python.org/downloads/二、安装1.为了避免自己配置环境变量,勾选添加至path2.直接下一步3.全选点击install4.在dos窗口中输入python,出现以下界面表示安装成功......
  • python版本的playwright如何使用代理
      fromplaywright.sync_apiimportPlaywright,sync_playwrightwithsync_playwright()asplaywright:browser=playwright.chromium.launch()proxy_server='http://my-proxy-server.com:8080'context=browser.new_context(proxy={......
  • QA|workon env后没有进入虚拟环境,但也没有报错,但cmd可以|Python虚拟环境
    问题:pycharm的terminal执行workonenv后没有进入虚拟环境,但也没有报错  但cmd可以 原因:因为pycharm的terminal用的是powershell,更改为cmd,重新打开pycharm项目 然后重新创建虚拟环境并进入就可以成功了:   参考:workonenv后没有进入虚拟环境,但也没有报错-慕课......
  • python版本的 playwright , 如何拦截请求,替换响应内容
         fromplaywright.sync_apiimportPlaywright,sync_playwrightdefrequest_interceptor(route,request):logger.info(request.url)if'api.js'inrequest.url:#替换响应内容route.fulfill(status=200,......
  • Linux搭建C++开发环境
    Linux搭建C++开发环境https://blog.csdn.net/weixin_44666217/article/details/127594532LinuxC/C++开发环境搭建https://blog.csdn.net/zcteo/article/details/117528089 ......
  • python talib中文技术分析库
    ADChaikinA/D线ADOSCChaikinA/DOscillatorChaikin震荡指标---|---简介:将资金流动情况与价格行为相对比,检测市场中资金流入和流出的情况---|---计算公式:fastperiodA/D-slowperiodA/D研判:1、交易信号是背离:看涨背离做多,看跌背离做......