windows下,安装python的chardet办法

windows下,安装python的chardet办法
背景
想要安装python下面的chardet库。

【解决过程】

1.从官网

http://pypi.python.org/pypi/chardet#downloads

中下载了chardet-2.2.1.tar.gz

解压后,进去目录去运行setup.py,结果出错:

D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1>python setup.py
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup
ImportError: No module named setuptools
 
D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1> setup.py install
Traceback (most recent call last):
File "D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1\setup.py", line 1, in <module>
from setuptools import setup
ImportError: No module named setuptools
 
D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1>setup.py install
Traceback (most recent call last):
File "D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1\setup.py", line 1, in <module>
from setuptools import setup
ImportError: No module named setuptools
 
D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1>python setup.py
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup
ImportError: No module named setuptools
 
D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1>setup.py build
Traceback (most recent call last):
File "D:\python\chardet\chardet-2.2.1.tar\chardet-2.2.1\setup.py", line 1, in <module>
from setuptools import setup
ImportError: No module named setuptools

网上找了一堆解释,也都没用。

后来才知道,需要安装对应的setuptools的。

setuptools 安装好,再执行这个按照就ok啦.

1 评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注