Home Download Buy Blog Forum Support

Missing urllib2 on osx

Missing urllib2 on osx

Postby shvva on Sun Mar 17, 2013 11:26 pm

Hi,

While I'm using st3 build 3021 on osx, it would appear that st3 doesn't have urllib2 in the embedded Python as a module.

How can I work around this ?

Any idea ?

Code: Select all
>>> import urllib2
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'urllib2'
shvva
 
Posts: 7
Joined: Sun Dec 30, 2012 9:31 pm

Re: Missing urllib2 on osx

Postby jps on Mon Mar 18, 2013 1:41 am

urllib2 does not exist in Python 3
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Missing urllib2 on osx

Postby skuroda on Mon Mar 18, 2013 2:06 am

As for workarounds (don't know if you are writing a plugin or using one but either way).

http://docs.python.org/2/library/urllib2.html wrote:Note The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: Missing urllib2 on osx

Postby shvva on Tue Mar 19, 2013 1:27 am

Thank you for quick response, all.

Now I have realized that I should use urllib.parse in Python 3 instead.

Thank you for your help on this !
shvva
 
Posts: 7
Joined: Sun Dec 30, 2012 9:31 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 7 guests