Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:04:54+00:00 2026-06-11T15:04:54+00:00

[Windows 7 64 bit; Python 2.7] If I try to use Urllib2, I get

  • 0

[Windows 7 64 bit; Python 2.7]

If I try to use Urllib2, I get this error

Traceback (most recent call last):
  File "C:\Users\cYanide\Documents\Python Challenge\1\1.py", line 7, in <module>
    response = urllib2.urlopen('http://python.org/')
  File "C:\Python27\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Python27\lib\urllib2.py", line 400, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
**urllib2.HTTPError: HTTP Error 407: Proxy Authentication Required**

Now, I’m behind a college proxy which requires authentication so that’s probably the reason why this is happening. But isn’t Urllib2 supposed to pull the authentication and proxy information from the system settings?

I understand there’s some extra code I can insert into my program to ‘hardcode’ the proxy information in the program but I really don’t want to do that unless it’s the last resort. It would hinder the portability of the program across computers with different authentication IDs and Passwords in the college.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:04:55+00:00Added an answer on June 11, 2026 at 3:04 pm

    Your program should see the environment variables which are set in Windows. So have these two environment variables in your Windows.

    HTTP_PROXY = http://username:password@proxyserver.domain.com

    HTTPS_PROXY = https://username:password@proxyserver.domain.com

    And go ahead with executing your script. It should pick up the proper authenticators and proceed with the connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a new 64-bit Windows machine and use python for various things and
I am running 64-bit Windows 7 and the Python 2.6 installation (64-bit version). In
I am running 32-bit Windows 7 and Python 2.7. I am trying to write
I have a 64 bit windows operating system and I use VS2008 to write
I'm running 32-bit Windows 7 Enterprise and CodeBlocks 10.05. I followed this tutorial to
(Running MingW on 64-bit Windows 7 and the GCC on Kubuntu) This may possibly
I am running 64-bit Windows 7 and the ActiveState Python 2.5 installation (64-bit version).
I am trying to package a python application on my 64 bit windows 7
Running Python 3.2 on Windows 7 Pro 64 Bit. OK I have some very
I'm running Python 2.7.2 (64 Bit) on Windows 7. I'm a little confused about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.