Skip to content

Instantly share code, notes, and snippets.

@nmarchini
Last active October 7, 2020 12:01
Show Gist options
  • Save nmarchini/1a5a00fa20e195815dfdf9fa1909db2b to your computer and use it in GitHub Desktop.
Save nmarchini/1a5a00fa20e195815dfdf9fa1909db2b to your computer and use it in GitHub Desktop.
# Add trusted hosts to the pip configuration on a per user basis.
On Unix the default configuration file is: $HOME/.config/pip/pip.conf which respects the XDG_CONFIG_HOME environment variable.
On macOS the configuration file is $HOME/Library/Application Support/pip/pip.conf if directory $HOME/Library/Application Support/pip exists else $HOME/.config/pip/pip.conf.
On Windows the configuration file is %APPDATA%\pip\pip.ini.
- Create the pip.ini or pip.conf file as requred for your OS
- Copy the code below into the file and save
[global]
timeout = 60
trusted-host =
pypi.org
files.pythonhosted.org
Restart your terminal session and try the pip install/command again.
Referance = https://pip.pypa.io/en/stable/user_guide/#config-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment