Windows 下安裝 OpenCC

來源:互聯網
上載者:User

什麼是OpenCC? 請到這查看

當你很開心的使用以下指令,你就會踢到一個很痛的鐵版。 ?

1 C:\>pip install opencc-python

然後Python就會跟你抱怨下面的事,

Downloading/unpacking opencc-python
Running setup.py (path:c:\users\xxxx\appdata\local\temp\pip_build_xxxx\opencc-python\setup.py) egg_info for package opencc-python
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\jason\appdata\local\temp\pip_build_xxxx\opencc-python\setup.py", line 1, in <module>
from distribute_setup import use_setuptools
ImportError: No module named distribute_setup
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "c:\users\jason\appdata\local\temp\pip_build_xxxx\opencc-python\setup.py", line 1, in <module>

from distribute_setup import use_setuptools

ImportError: No module named distribute_setup

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\xxxx\appdata\local\temp\pip_build_xxxx\opencc-python
Storing debug log for failure in C:\Users\Jason\pip\pip.log

解法:

下載 distribute_setup.zip

解壓縮後,把distribute_setup.py放到C:\你安裝Python的目錄\Lib(例如:C:\Python27\Lib)

再執行一次 ?

1 C:\>pip install opencc-python

Downloading/unpacking opencc-python
Running setup.py (path:c:\users\xxxx\appdata\local\temp\pip_build_xxxx\opencc-python\setup.py) egg_info for package opencc-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
Extracting in c:\users\xxxx\appdata\local\temp\tmpeuwfpm
Now working in c:\users\xxxx\appdata\local\temp\tmpeuwfpm\distribute-0.6.27
Building a Distribute egg in c:\users\xxxx\appdata\local\temp\pip_build_xxxx\opencc-python
c:\users\xxxx\appdata\local\temp\pip_build_xxxx\opencc-python\distribute-0.6.27-py2.7.egg

Requirement already satisfied (use --upgrade to upgrade): distribute in c:\python27_x64\lib\site-packages (from opencc-python)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.7 in c:\
python27_x64\lib\site-packages (from distribute->opencc-python)
Installing collected packages: opencc-python
Running setup.py install for opencc-python

Successfully installed opencc-python
Cleaning up...

順利完成安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.