ImportError: No module named 'urllib2' when installing Package Manager in Sublime Text 3
python-3.x, sublimetext3, urllib2
Solution
It appears that you followed the instructions for installing on Sublime Text 2. For now on Sublime Text 3 you must install using `git`. The instructions from the site follows:
cd Packages/
git clone https://github.com/wbond/sublime_package_control.git "Package Control"
cd "Package Control"
git checkout python3
Note: The `Packages/` folder on the first line refers to the folder that opens when you use the Preferences > Browse Packages… menu.
Here is a link to the relavant section of the page
Problem
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?