我有anaconda软件包并运行Spyder。这是我的系统信息:
anaconda 2018.12 py37_0
Python 3.7.1
pip 18.1
Dell Inspiron 13 7000 64-bit
Run Code Online (Sandbox Code Playgroud)
我无法从命令提示符下使用pip安装任何内容。例如,在尝试安装numpy时(通过anaconda已经拥有),我得到以下信息:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: numpy in c:\users\uday rallabhandi\anaconda3\lib\site-packages (1.15.4)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't …Run Code Online (Sandbox Code Playgroud) 假设我在 Python 中运行了这段代码:
while True:
try:
anything that doesn't break loop
except: pass
Run Code Online (Sandbox Code Playgroud)
我怎样才能让它停止呢?(注意:我怀疑这不是我应该通过测试来学习的时候)。
当然,实际上我会使用一个break声明。这是一个理论问题;即使传递了一个 KeyboardInterrupt,又如何打破这个循环呢?