第一次尝试:
因为装了easy_install,转到D:\python27\Scripts下执行easy_install chardet得到是chardet-2.3.0-py2.7.egg,执行
结果提示:Installed d:\python27\lib\site-packages\chardet-2.3.0-py2.7egg
Processing dependencies for chardet
Finished processing dependencies for chardet
>>>import chardet
报错:ImportError: No module named chardet
第二次尝试:
自己下载源包,解压后,转到解压目录下,执行setup.py install得到的还是chardet-2.3.0-py2.7.egg,执行
结果提示:Installed d:\python27\lib\site-packages\chardet-2.3.0-py2.7egg
Processing dependencies for chardet
Finished processing dependencies for chardet
>>>import chardet
报错:ImportError: No module named chardet
第3次尝试:
官网和网友推荐的方法是执行命令:pip install chardet
最终解决方案ÿ