执行python脚本时提示:No module named 'pymysql'/requests,需要安装。
[root@localhost python_tencent]# python3 casb_data.py
Traceback (most recent call last):
File "casb_data.py", line 7, in
import pymysql
ModuleNotFoundError: No module named 'pymysql'
$pip3 install pymysql
[root@localhost python_tencent]# pip3 install pymysql Collecting pymysql Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB) |████████████████████████████████| 43 kB 467 kB/s Installing collected packages: pymysql Successfully installed pymysql-1.0.2 WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available. You should consider upgrading via the '/usr/local/python3/bin/python3.8 -m pip install --upgrade pip' command. |
$pip3 install requests
[root@localhost python_tencent]# pip3 install requests Collecting requests Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB) |████████████████████████████████| 61 kB 194 kB/s Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB) |████████████████████████████████| 153 kB 42 kB/s Collecting certifi>=2017.4.17 Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB) |████████████████████████████████| 147 kB 35 kB/s Collecting chardet<5,>=3.0.2 Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB) |████████████████████████████████| 178 kB 37 kB/s Collecting idna<3,>=2.5 Downloading idna-2.10-py2.py3-none-any.whl (58 kB) |████████████████████████████████| 58 kB 31 kB/s Installing collected packages: urllib3, certifi, chardet, idna, requests Successfully installed certifi-2020.12.5 chardet-4.0.0 idna-2.10 requests-2.25.1 urllib3-1.26.4 |
Linux centos,pip安装requests_pkcs12
因使用pip3 install requests_pkcs12报错
安装pip,使用pip安装
$python3 -m pip install --upgrade pip
$pip install requests_pkcs12
安装位置:
10.1.1.191
/usr/local/lib/python3.6/site-packages