简体   繁体   English

如何在 pycharm 包安装中添加 --trusted-host?

[英]How do I add the --trusted-host in pycharm package install?

I installed Pycharm community Edition 2016.1.4 on a Windows 7 machine and tried to update some packages used by the project I intend to work on.我在 Windows 7 机器上安装了 Pycharm 社区版 2016.1.4 并尝试更新我打算工作的项目使用的一些包。 The update failed because the local repository " is not trusted or a secure host " (according to pip ), so to update packages in the command-line I need to run:更新失败,因为本地存储库“不受信任或不安全主机”(根据pip ),因此要在命令行中更新包,我需要运行:

pip install <package> --trusted-host <insecure-host>

Is it possible to specify in PyCharm that --trusted-host option or is Pycharm so concerned about my security that it won't allow me to do so?是否可以在 PyCharm 中指定--trusted-host选项,或者 Pycharm 是否非常关心我的安全性以致于不允许我这样做?

After some digging I found the answer.经过一番挖掘,我找到了答案。 Registering it here in case someone is interested.如果有人感兴趣,请在此处注册。

Go to前往

File --> Settings --> Project: name_of_the_project --> Project Interpreter文件-->设置--> 项目: name_of_the_project -->项目解释器

Choose (double click) the package you want to update and the Available Packages will pop-up.选择(双击)您要更新的包,将弹出可用包 There is a checkbox Options on the lower-left part of the window.窗口左下方有一个复选框选项 Check that and enter检查并输入

--trusted-host hostname --trusted-host 主机

Option and hit the Install Package button.选项并点击安装包按钮。

That way I was able to update the package from the insecure host, thus solving my problem.这样我就可以从不安全的主机更新包,从而解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM