windows下,安装python的chardet办法

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

【解决过程】

1.从官网

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

中下载了chardet-2.2.1.tar.gz

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

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

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

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

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

windows下,安装python的chardet办法》有1个想法

发表评论

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.