关于python中pip安装库过程中报错的解决办法
晚上使用flask框架搭建web服务,启动后报错如下:
1 | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. |
经过搜索大法,发现是因为在开发环境中,Flask应用程序是使用内置的服务器(如SimpleServer或Lighttpd)运行的,而不是使用WSGI服务器。于是,尝试安装Gevent和pywsgi库。
1 | pip install gevent pywsgi |
结果又报错(好好好)
1 2 | ERROR: Could not find a version that satisfies the requirement pywsgi ( from versions: none) ERROR: No matching distribution found for pywsgi |
使用pip更新:
1 | python - m pip install - - upgrade pip |
更新后再用pip命令安装,又报错:
1 2 | ERROR: Could not find a version that satisfies the requirement pywsgi ( from versions: none) ERROR: No matching distribution found for pywsgi |
看样子应该是网络问题,使用指定源进行安装,命令如下:
1 | pip3 install [你要安装的包] - i http: / / mirrors.aliyun.com / pypi / simple / - - trusted - host mirrors.aliyun.com |
最后,问题解决。
本文作者:KEEP12
本文链接:https://www.cnblogs.com/ikillyou/p/17860635.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步