※This article is based on Python 3.7.3
pip install scikit-learn #下载scikit-learn
只要在下载软件的后面加上==号,写入版本号即可!
pip install 软件名==版本号
# 下载scikit-learn的0.18.0版本
pip install scikit-learn==0.18.0
# 以管理者身份下载scikit-learn的0.18.0版本
pip install --user-v scikit-learn==0.18.0
#将库中的python模块用作脚本去运行安装scikit-learn
python -m pip install scikit-learn
安装python3.x的pip
sudo apt-get install python3-pip
报错:
Collecting pip Using cached https://files.pythonhosted.org/packages/52/e1/06c018197d8151383f66ebf6979d951995cf495629fc54149491f5d157d0/pip-21.2.4.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\users\tzzha\appdata\local\temp\pip-build-nzbfrv\pip\setup.py", line 7 def read(rel_path: str) -> str: ^ SyntaxError: invalid syntax ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in c:\users\tzzha\appdata\local\temp\pip-build-nzbfrv\pip\ You are using pip version 8.1.2, however version 21.2.4 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
解决
python -m pip install --user --upgrade pip==20.2.4 #(换成你想要的版本编号)
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/virtualenv/ Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
pip install virtualenv -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
python没有SSL模块,需重新编译安装python
Note HTTPS support is only available if Python was compiled with SSL support (through the ssl module).
https://docs.python.org/3/library/http.client.html
コメント: