pip安装
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Python]]
&color(red){※This article is based on Python 3.7.3};
#contents
* pip安装第三方库 [#r75ed322]
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
* 安装pip [#g96cc3cf]
安装python3.x的pip
sudo apt-get install python3-pip
* 问题 [#g05c16b9]
** pip无法升级 [#d5b36b31]
报错:
#codeprettify{{
Collecting pip
Using cached https://files.pythonhosted.org/packages/52...
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-n...
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code...
You are using pip version 8.1.2, however version 21.2.4 i...
You should consider upgrading via the 'python -m pip inst...
}}
解决
python -m pip install --user --upgrade pip==20.2.4 #(换...
** ssl certificate [#xaf99a28]
#codeprettify{{
WARNING: Retrying (Retry(total=2, connect=None, read=None...
Could not fetch URL https://pypi.org/simple/virtualenv/: ...
}}
*** 解决方法 [#s7babc1c]
先安装 virtualenv
pip install virtualenv -i http://mirrors.aliyun.com/pypi...
** Ubuntu urllib2.URLError:<urlopen error unknown url typ...
*** 原因 [#g9b3b7ec]
是因为 Python 不支持 openssl 造成的,需要重新编译安装 pyt...
参考官网
Note HTTPS support is only available if Python was compi...
https://docs.python.org/3/library/http.client.html
*** 解决方法 [#s7babc1c]
在安装python之前,需要先安装 openssl
./config
sudo make
sudo make install
安装 python 时如下配置之后安装
./configure --prefix=/root/python38 --with-openssl=/root...
make
make install
注意:/root/openssl-1.1.0l路径为openssl官网下载的源码包解...
安装后的验证:启动 python 命令行然后输入下面
import ssl
** ubuntu WARNING: Download failure <urlopen error [SSL: ...
*** 解决方法 [#ma9bff2d]
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs
** AttributeError: module 'serial' has no attribute 'seri...
*** 解决方法 [#gbf4ae42]
许多人从网上找到串口代码后,直接安装了serial,无法运行,...
如果你是按上述情况操作的,即使卸载了serial也无济于事,必...
#hr();
コメント:
#comment_kcaptcha
終了行:
[[Python]]
&color(red){※This article is based on Python 3.7.3};
#contents
* pip安装第三方库 [#r75ed322]
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
* 安装pip [#g96cc3cf]
安装python3.x的pip
sudo apt-get install python3-pip
* 问题 [#g05c16b9]
** pip无法升级 [#d5b36b31]
报错:
#codeprettify{{
Collecting pip
Using cached https://files.pythonhosted.org/packages/52...
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-n...
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code...
You are using pip version 8.1.2, however version 21.2.4 i...
You should consider upgrading via the 'python -m pip inst...
}}
解决
python -m pip install --user --upgrade pip==20.2.4 #(换...
** ssl certificate [#xaf99a28]
#codeprettify{{
WARNING: Retrying (Retry(total=2, connect=None, read=None...
Could not fetch URL https://pypi.org/simple/virtualenv/: ...
}}
*** 解决方法 [#s7babc1c]
先安装 virtualenv
pip install virtualenv -i http://mirrors.aliyun.com/pypi...
** Ubuntu urllib2.URLError:<urlopen error unknown url typ...
*** 原因 [#g9b3b7ec]
是因为 Python 不支持 openssl 造成的,需要重新编译安装 pyt...
参考官网
Note HTTPS support is only available if Python was compi...
https://docs.python.org/3/library/http.client.html
*** 解决方法 [#s7babc1c]
在安装python之前,需要先安装 openssl
./config
sudo make
sudo make install
安装 python 时如下配置之后安装
./configure --prefix=/root/python38 --with-openssl=/root...
make
make install
注意:/root/openssl-1.1.0l路径为openssl官网下载的源码包解...
安装后的验证:启动 python 命令行然后输入下面
import ssl
** ubuntu WARNING: Download failure <urlopen error [SSL: ...
*** 解决方法 [#ma9bff2d]
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs
** AttributeError: module 'serial' has no attribute 'seri...
*** 解决方法 [#gbf4ae42]
许多人从网上找到串口代码后,直接安装了serial,无法运行,...
如果你是按上述情况操作的,即使卸载了serial也无济于事,必...
#hr();
コメント:
#comment_kcaptcha
ページ名: