Corporate network install Rust && setup git && setup pip

Pub Date: 2023-09-01

open powershell

#download rustup-init
wget https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup/archive/1.26.0/x86_64-pc-windows-msvc/rustup-init.exe
#set proxy
$env:http_proxy="http://proxy.xj.petrochina:8080/"
$env:https_proxy="http://proxy.xj.petrochina:8080/"
#set rustup mirror
$env:RUSTUP_UPDATE_ROOT="https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup"
$env:RUSTUP_DIST_SERVER="https://mirrors.tuna.tsinghua.edu.cn/rustup"
#install nightly
./rustup-init.exe -y --default-toolchain nightly --profile complete

set environment variables in Linux Macos Windows

#linux/macos
export KEY=VALUE
#windows powershell
$env:KEY="VALUE"
#windows CMD
set KEY="VALUE"

set git proxy

git config --global http.proxy http://proxy.xj.petrochina:8080

pip install with proxy

python.exe -m pip --proxy http://proxy.xj.petrochina:8080 install --upgrade pip
pip  --proxy http://proxy.xj.petrochina:8080 install -i https://pypi.tuna.tsinghua.edu.cn/simple  python-opencv

npm install with proxy

npm config set proxy="http://proxy.xj.petrochina:8080/"