热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

sublimetext3包控制安装

如何解决《sublimetext3包控制安装》经验,为你挑选了2个好方法。

我有一个问题,当我安装sublime文本3的包控件因为代理集但我需要安装一个插件所以任何人都可以帮助我吗?当我在控制台中执行getproxy时它返回我{}当我尝试在控制台中使用python设置代理时

urllib.set_proxy(' http:// user:password @ server:port ','http')

我用他们的值替换了用户,密码,服务器和端口,但它返回了我

raceback (most recent call last):
File "", line 1, in 
AttributeError: 'module' object has no attribute 'set_proxy'

我该怎么做才能使它有效?我需要安装一个插件



1> mattst..:

设置程序包控制从代理服务器后面工作

您需要在设置中设置代理服务器Package Control.

将下面的代码复制并粘贴到一个Package Control.sublime-settings必须保存在User配置文件夹中的文件中.该文件夹与保存USER Preferences.sublime-settings文件的文件夹相同.数据目录说明了操作系统中的位置.即

视窗: %APPDATA%\Sublime Text 3\Packages\User\Package Control.sublime-settings

OS X: ~/Library/Application Support/Sublime Text 3/Packages/User/Package Control.sublime-settings

Linux的: ~/.config/sublime-text-3/Packages/User/Package Control.sublime-settings

显然,您必须在下面的相关字段中添加域和端口以及您的用户名和密码.代理应采用以下形式:proxyserver:port.例如

{
    "http_proxy": "server.com:80",
    "https_proxy": "server.com:8080",
    "proxy_username": "mynameis",
    "proxy_password": "mypassis",
}

另请参阅:包控制设置

{
    // An HTTP proxy server to use for requests. Not normally used on Windows
    // since the system proxy configuration is utilized via WinINet. However,
    // if WinINet is not working properly, this will be used by the Urllib
    // downloader, which acts as a fallback.
    "http_proxy": "",

    // An HTTPS proxy server to use for requests - this will inherit from
    // http_proxy if it is set to "" or null and http_proxy has a value. You
    // can set this to false to prevent inheriting from http_proxy. Not
    // normally used on Windows since the system proxy configuration is
    // utilized via WinINet. However, if WinINet is not working properly, this
    // will be used by the Urllib downloader, which acts as a fallback.
    "https_proxy": "",

    // Username and password for both http_proxy and https_proxy. May be used
    // with WinINet to set credentials for system-level proxy config.
    "proxy_username": "",
    "proxy_password": "",
}



2> Vivek..:

您只需在Sublime 3控制台(使用CTRL+` 或启动控制台View -> Show Console)中运行以下命令即可。

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler({'http': 'http://USER:PASSWORD@HOST:PORT', 'https': 'https://USER:PASSWORD@HOST:PORT'})) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

在上面的代码,你需要更换价值(USER:PASSWORD@HOST:PORT中)httphttps键按您的代理详细信息

然后点击Enter,它将Package Control使用提供的代理安装


推荐阅读
author-avatar
手浪用户2602928705
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有