I'm trying to install Sublime Package Control as explained here http://wbond.net/sublime_packages/package_control/installation but get an error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'urllib2'
There is some answer related to the problem (Python 3.2 Unable to import urllib2 (ImportError: No module named urllib2)) but it doesn't explain how to solve it, a user just posted a link explaining why the problem appears. But how to use that info to solve the problem?
This is a command for installation:
import urllib2,os;
pf='Package Control.sublime-package';
ipp=sublime.installed_packages_path();
os.makedirs(ipp) if not os.path.exists(ipp) else None;
urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));
open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read());
print('Please restart Sublime Text to finish installation')
What with should I replace urllib2
to succeed installation?