脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|shell|

服务器之家 - 脚本之家 - Python - 解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

2023-06-09 14:30orac-min Python

准备用pip安装一下you-get这个包,出现报错:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

PS C:Users > pip install pip
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.

#win10:Windows powershell

#2022/8/17

#users:fanch

这次准备用pip安装一下you-get这个包,出现上面报错:

报错内容一:
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.

这里提示我们缺少openssl模块

 

下面我们分别来解决这两个问题:

part1:

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

 首先进入  ‪E:nacondaLibsite-packages 这个指定位置,修改用户的读写权限

 

-----------------------------(在这之前,还应当把这几条路径加入环境变量)----------------------------------

已添加则忽略该部分

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

 右击此电脑>高级系统设置>高级>环境变量>添加环境变量

 

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not———————————————————————————————————————————

 

修改了文件夹的读写权限之后,报错内容为 

part2:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

PS C:Usersanch> pip install you-get
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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/you-get/
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/you-get/
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/you-get/
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/you-get/
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/you-get/
Could not fetch URL https://pypi.org/simple/you-get/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/you-get/ (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 you-get (from versions: none)
ERROR: No matching distribution found for you-get

即缺少了SSL模块,进入 Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions https://slproweb.com/products/Win32OpenSSL.html

选择 Win64 OpenSSL v1.1.1q Light 的 MSI进行下载点击安装即可

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

 这之后  you-get命令还是不能使用,一方面你需要返回第一步,改写相关的几个文件夹Lib和script的读写权限,另一方面需要删除 e:nacondalibsite-packages下原有的安装文件

PS C:Users> pip install you-get
Requirement already satisfied: you-get in e:nacondalibsite-packages (0.4.1620)
PS C:Users> you-get
you-get : The term 'you-get' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of t
he name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ you-get
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (you-get:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not

 

 

然后重新运行pip install you-get 命令就可以正常使用了


PS C:Users> pip install you-get
Collecting you-get
  Using cached you_get-0.4.1620-py3-none-any.whl (230 kB)
Installing collected packages: you-get
Successfully installed you-get-0.4.1620


PS C:Users> you-get.exe
usage: you-get [OPTION]... URL...

A tiny downloader that scrapes the web

optional arguments:
  -V, --version         Print version and exit
  -h, --help            Print this help message and exit

......

 

到此这篇关于解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not的文章就介绍到这了,更多相关Python请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文地址:https://blog.csdn.net/qq_49580107/article/details/126380616

延伸 · 阅读

精彩推荐
  • PythonDjango2.2配置xadmin的实现

    Django2.2配置xadmin的实现

    这篇文章主要介绍了Django2.2配置xadmin的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着...

    temls7562021-10-27
  • Python用python制作个论文下载器(图形化界面)

    用python制作个论文下载器(图形化界面)

    这篇文章主要介绍了用python制作个论文下载器(图形化界面),帮助大家更好的理解和学习使用python,感兴趣的朋友可以了解下...

    不正经的kimol君8772021-09-29
  • Python使用Python编写vim插件的简单示例

    使用Python编写vim插件的简单示例

    这篇文章主要介绍了使用Python编写vim插件的简单教程,文中举了一个获取reddit首页信息并显示在缓冲区中的例子,需要的朋友可以参考下 ...

    脚本之家3452020-06-09
  • Pythonpython类继承用法实例分析

    python类继承用法实例分析

    这篇文章主要介绍了python类继承用法,实例分析了Python类的定义与类继承的实现技巧,需要的朋友可以参考下 ...

    依山带水2572020-07-08
  • PythonPython实现大乐透号码随机生成

    Python实现大乐透号码随机生成

    全国有很多彩民,其中购买最多的彩种分别是体彩大乐透和福彩双色球。本篇文章将介绍Python实现彩票自由的全流程:随机选取号码+查看是否中奖,需要的...

    煎蛋哥6642023-02-10
  • Pythonpyx文件 生成pyd 文件用于 cython调用的实现

    pyx文件 生成pyd 文件用于 cython调用的实现

    这篇文章主要介绍了pyx文件 生成pyd 文件用于 cython调用的实现方式,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...

    darren2015zdc10742021-09-14
  • Python一文解决Python切换版本问题

    一文解决Python切换版本问题

    由于mac默认都会安装python2.x,这给我们python开发造成不便,我们经常要用到python3.x的版本来进行测试、开发,所以本文主要介绍了Python切换版本问题,感兴...

    一只不守妇道的花喵8592021-12-13
  • PythonPython实现将一个大文件按段落分隔为多个小文件的简单操作方法

    Python实现将一个大文件按段落分隔为多个小文件的简单操作方法

    这篇文章主要介绍了Python实现将一个大文件按段落分隔为多个小文件的简单操作方法,涉及Python针对文件的读取、遍历、转换、写入等相关操作技巧,需要的...

    捂汗县长3442020-09-29