当前位置:   article > 正文

解决 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 modul
  1. PS C:\Users\ > pip install pip
  2. Defaulting to user installation because normal site-packages is not writeable
  3. 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:

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

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

已添加则忽略该部分

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

 

———————————————————————————————————————————

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

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

  1. PS C:\Users\fanch> pip install you-get
  2. WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  3. 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/
  4. 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/
  5. 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/
  6. 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/
  7. 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/
  8. 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
  9. ERROR: Could not find a version that satisfies the requirement you-get (from versions: none)
  10. ERROR: No matching distribution found for you-get

即缺少了SSL模块,进入 Win32/Win64 OpenSSL Installer for Windows - Shining Light Productionsicon-default.png?t=M666https://slproweb.com/products/Win32OpenSSL.html

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

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

  1. PS C:\Users\> pip install you-get
  2. Requirement already satisfied: you-get in e:\anaconda\lib\site-packages (0.4.1620)
  3. PS C:\Users\> you-get
  4. 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
  5. he name, or if a path was included, verify that the path is correct and try again.
  6. At line:1 char:1
  7. + you-get
  8. + ~~~~~~~
  9. + CategoryInfo : ObjectNotFound: (you-get:String) [], CommandNotFoundException
  10. + FullyQualifiedErrorId : CommandNotFoundException

 

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

  1. PS C:\Users\> pip install you-get
  2. Collecting you-get
  3. Using cached you_get-0.4.1620-py3-none-any.whl (230 kB)
  4. Installing collected packages: you-get
  5. Successfully installed you-get-0.4.1620
  6. PS C:\Users\> you-get.exe
  7. usage: you-get [OPTION]... URL...
  8. A tiny downloader that scrapes the web
  9. optional arguments:
  10. -V, --version Print version and exit
  11. -h, --help Print this help message and exit
  12. ......

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/423642
推荐阅读
相关标签
  

闽ICP备14008679号