помогите пожалуйста решить проблему на ununtu поставил sublime3. далее пытаюсь поставить плагин для ftp. открываю консоль и ввожу
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')
в результате получаю следующее сообщение об ошибке:
>>> 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')
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'urllib2'
выполяю в терминале:
kalinins@kalinins-Lenovo-Z580 ~/.local $ pip install urllib2
Downloading/unpacking urllib2
Real name of requirement urllib2 is urllib3
Could not find any downloads that satisfy the requirement urllib2
Cleaning up...
No distributions at all found for urllib2
Storing debug log for failure in /home/kalinins/.pip/pip.log
pip.log:
Removing temporary dir /tmp/pip_build_kalinins...
No distributions at all found for urllib2
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for urllib2