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

  • SEARCH
  • Home
  • 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 7838559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:08:34+00:00 2026-06-02T15:08:34+00:00

I am trying to use urllib.parse.urlencode() method in one of my scripts. import urllib

  • 0

I am trying to use urllib.parse.urlencode() method in one of my scripts.
import urllib

#!/usr/bin/python3.2

import urllib

data = urllib.parse.urlencode({'type': 'device_code','client_id': 150792241632891})

It was working before but now I get following error.

Output

Traceback (most recent call last):
  File "/home/rakesh/programming/test.py", line 8, in <module>
    data = urllib.parse.urlencode({'type': 'device_code','client_id': 150792241632891})
AttributeError: 'module' object has no attribute 'parse'

Initially I doubt my python shell but when I checked it is using python version 3.2 which should be fiine.

Now I am totally perplexed why python shell is behaving this way.
Am I missing something here?

Thanks

  • 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-02T15:08:35+00:00Added an answer on June 2, 2026 at 3:08 pm

    You’re not showing the imports in your program, so I can’t be sure, but I bet you did

    import urllib
    

    which will not import and re-export the separate module urllib.parse. Do

    import urllib.parse
    

    instead.

    (import urllib is rather senseless in Python 3.x, since all the functionality is in the submodules and these are not imported by the toplevel module.)

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

Sidebar

Related Questions

I have a problem. I'm trying to use urllib library in python. but, I
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
I'm trying to use urllib and urllib2 to read from a text file that
I'm trying to use youtube's data api to search where the search term includes
I am trying to use xml.etree.ElementTree to parse responses from eBay finding API, findItemsByProduct.
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I am trying use a Java Uploader in a ROR app (for its ease
Hi I'm trying use a datepicker on a field I have. I'm trying to

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.