Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
405 views
in Technique[技术] by (71.8m points)

python - Proxy Authentication Required NLTK download

I have installed python 2.7.3 on a Windows 8, 64 bit machine, sublime text and nltk 3.0.1 with the following steps:

  • Install Setuptools: http://pypi.python.org/pypi/setuptools and run ez_setup.py from the directory stored in python27 (from CMD prompt)

  • Install NLTK: http://pypi.python.org/pypi/nltk In nltk directory run setup.py to install nltk (from CMD prompt)

  • Change the environmental variables to %PYTHONPATH%;C:Python27;C:Python27DLLs;C:Python27Lib;C:Python27Liblib2to3;C:Python27Scripts with PYTHONPATH with C:Python27

Test installation: Start>Python34, then type import nltk in sublime type

import nltk
nltk.set_proxy('xxx.xx.xx.xx:yy',('username','pwd'))
nltk.download()

However, I am met with the following error:

HTTP Error 407: Proxy Authentication Required (The ISA Server requires   authorization to fulfill the request. Access to the Web Proxy Filter is denied.

Despite giving the proxy details why am I getting this error?

Please help, Arc.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this format instead for setting the proxy details:

import nltk
nltk.set_proxy('https://username:password@proxy.example.com:port')

It worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...