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

推荐订阅源

美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
宝玉的分享
宝玉的分享
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
博客园 - 司徒正美
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - Franky
B
Blog
V
V2EX
J
Java Code Geeks
D
Docker
博客园 - 叶小钗
The Cloudflare Blog
量子位
博客园_首页
MongoDB | Blog
MongoDB | 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