12

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. 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 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?

gmauch
  • 1,316
  • 4
  • 25
  • 39

1 Answers1

20

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

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

Option and hit the Install Package button.

That way I was able to update the package from the insecure host, thus solving my problem.

gmauch
  • 1,316
  • 4
  • 25
  • 39
  • Is there way to install using requirments.txt file using pycharm? – sfgroups Oct 11 '18 at 13:40
  • @sfgroups [This question](https://stackoverflow.com/questions/25376213/delete-unused-packages-from-requirements-file) might help you. – gmauch Oct 11 '18 at 17:00
  • I've just answered [this question](https://stackoverflow.com/questions/59103592/adding-trusted-host-to-pycharm-package-installer) about the same thing, and contemplated marking it as a duplicate of this but... the OP was already entering `--trusted-host` in options but your answer doesn't explicitly state that you should enter `--trusted-host ` - if you'd care to add that in your answer, I can flag the other one as a duplicate. – David Buck Nov 29 '19 at 11:52
  • 1
    @DavidBuck just did as you asked! – gmauch Nov 29 '19 at 13:06
  • 1
    Do you know of any way to permanently add a trusted host to pycharm? – marijnr Mar 24 '23 at 10:33