python导入第三方类库(chardet)

1、pytcharm中报错

Traceback (most recent call last):
  File "C:/Users/ArcerZhang/Documents/Python/MyProjects/路飞学城-Python21天入门必备/第三章节 Python文件操作、函数、装饰器/71-文件处理-智能检测编码的工具.py", line 1, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

Process finished with exit code 1

2、安装第三方类库

C:\Users\ArcerZhang>cd C:\Users\ArcerZhang\AppData\Local\Programs\Python\Python36-32\Scripts

C:\Users\ArcerZhang\AppData\Local\Programs\Python\Python36-32\Scripts>dir
 驱动器 C 中的卷是 Windows7_OS
 卷的序列号是 5888-40CA

 C:\Users\ArcerZhang\AppData\Local\Programs\Python\Python36-32\Scripts 的目录

2017/12/14  15:04    <DIR>          .
2017/12/14  15:04    <DIR>          ..
2017/12/14  15:04            89,499 easy_install-3.6.exe
2017/12/14  15:04            89,499 easy_install.exe
2017/12/14  15:04            89,471 pip.exe
2017/12/14  15:04            89,471 pip3.6.exe
2017/12/14  15:04            89,471 pip3.exe
               5 个文件        447,411 字节
               2 个目录 124,068,610,048 可用字节

C:\Users\ArcerZhang\AppData\Local\Programs\Python\Python36-32\Scripts>pip3.6.exe install chardet
Collecting chardet
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 699kB/s
Installing collected packages: chardet
Successfully installed chardet-3.0.4
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\ArcerZhang\AppData\Local\Programs\Python\Python36-32\Scripts>

猜你喜欢

转载自www.cnblogs.com/arcer/p/9045312.html