惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
小众软件
小众软件
The Cloudflare Blog
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - 叶小钗
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
Y
Y Combinator Blog
D
Docker
Microsoft Azure Blog
Microsoft Azure Blog

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
Configuring Pip to Work in Enterprise Environments
2020-02-29 · via Stonecharioteer on Tech

The hardest thing about using package managers within an enterprise is getting them to download the packages you need on the office network. Oftentimes, you are hindered by SSL errors, and other times you get bogged by DNS errors.

Downloading External Packages

Most of us either disable SSL verification at this point or contact IT about getting trusted certificates. The former is a bad idea. The second option is not bad, but it does lead down the rabbithole of “why do you need this package?”

Instead, you should know that you can easily set some environment variables to help with this.

1
2
3
4
export HTTP_PROXY=http://<username>:<password>@<proxy.company.com>:<port>
export http_proxy=$HTTP_PROXY
export HTTPS_PROXY=http://<username>:<password>@<proxy.company.com>:<port>
export https_proxy=$HTTP_PROXY

This works for most tools. Some tools follow the Windows way, utilizing the uppercase values, and some use the lowercase. Now that’s food for thought. If you are writing your own tool that works with the internet, make sure to support both methods. This helps your users’ experience greatly.

The above settings should solve your dns issues, but they won’t help the SSL errors. For that, you will need to configure your tools specifically.

For pip, the easiest way is to use the configuration file. Before you do that, however, ensure you have updated pip to the latest version.

1
python3 -m pip install -U pip