无法使用 Anaconda 提示安装 pip PyMySQL
Posted
技术标签:
【中文标题】无法使用 Anaconda 提示安装 pip PyMySQL【英文标题】:Cant install pip PyMySQL using Anaconda prompt 【发布时间】:2020-08-29 18:25:32 【问题描述】:我尝试在 Anaconda 提示符下下载 pip install Pymysql(我使用 Spyder 作为 IDE)。它不工作。我收到了这个错误。有谁知道如何解决它?我正在使用 Python 3.7.4 64 位版本。提前谢谢你:)
(base) C:\Users\AK>pip install PyMySQL
Collecting PyMySQL
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC2F84C8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC30CC48>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319408>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319908>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E5EC319B88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/pymysql/
ERROR: Could not find a version that satisfies the requirement PyMySQL (from versions: none)
ERROR: No matching distribution found for PyMySQL
【问题讨论】:
【参考方案1】:这可能是由于您计算机上的防病毒软件或其他程序干扰了网络连接(请参阅pip install is not working)。
我可以通过以下方式安装 PyMySQL:
pip install PyMySQL
有几种可能的解决方案。
-
使用 conda 安装:
conda install pymysql
下载 PyMySQL 的 wheel 并使用该文件进行安装。
转到https://pypi.org/project/PyMySQL/#files 并下载.whl
文件。
运行pip install path/to/PyMySQL-0.9.3-py2.py3-none-any.whl
如果杀毒软件确实发挥了作用,那么我不知道该怎么办,但 google 是你的朋友。
【讨论】:
他们正在使用 anaconda,这对于使用哪个版本的 python 也非常明确 @jakub 如果我使用你的命令,我会得到:'python3' 不是内部或外部命令、可运行程序或批处理文件。 @AK28 - 然后使用pip install
。不过,我确实建议使用 python -m pip
语法,因为它更明确地说明了您指的是哪个 pip
。这可以防止安装到错误的环境中。
@jakub 最后!解决方案 2 对我有用。非常感谢!以上是关于无法使用 Anaconda 提示安装 pip PyMySQL的主要内容,如果未能解决你的问题,请参考以下文章
无法在命令提示符或 anaconda 提示符下安装 Snakemake
无法使用 pip 或 anaconda 安装 tensorflow
PyCharm+Eclipse共用Anaconda的数据科学环境