pip批量安装,pip使用国内源安装
1.
新建一个 requirements.txt,在其中写入要安装的库的名称,如下所示:
numpy
matplotlib
pandas
也可以加入版本号:
numpy==1.22.2
matplotlib==3.5.1
pandas==1.4.0
(注意,是双等号。)
2.
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
1.
新建一个 requirements.txt,在其中写入要安装的库的名称,如下所示:
numpy
matplotlib
pandas
也可以加入版本号:
numpy==1.22.2
matplotlib==3.5.1
pandas==1.4.0
(注意,是双等号。)
2.
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
如果使用的是密钥
"privateKeyPath": "C:\Users\Administrator\Desktop\key\smback"
如果使用的是密码
"password":"password",
单个服务器配置
{
"name": "ip1",
"context": "ip1",
"host": "ip1",
"protocol": "sftp",
"port": 22,
"username": "root",
"password":"password",
"ignore": [
"**/.vscode/**",
"**/.git/**",
"**/.DS_Store"
],
"remotePath": "/home/wwwroot/default",
"uploadOnSave": true
}
多台服务器配置
{
"name": "My Project",
"protocol": "sftp",
"ignore": [
"**/.vscode/**",
"**/.git/**",
"**/.DS_Store"
],
"remotePath": "/home/wwwroot/default",
"port": 22,
"profiles": {
"s1": {
"host": "IP1",
"username": "root",
"password": "password"
},
"s2": {
"host": "ip2",
"username": "root",
"password": "password"
}
},
"defaultProfile": "s1",
"uploadOnSave": true
}
http_build_query()函数的作用是使用给出的关联(或下标)数组生成一个经过 URL-encode 的请求字符串。
写法格式:http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] )
打个比方:$data = array("name"=>"callback" , "value"=>"test");
$rescult = http_build_query($data);
我们输出下$rescutl可以得到:
name=callback&value=test
这个有什么用呢,这是模拟http请求的,把得到的数据data通过函数URL-encode,一般是用在回调。
密钥直接随机字符串md5加密32位的即可。
docker run -d -p443:443 -v proxy-config:/data -e SECRET=密钥 telegrammessenger/proxy:latest
部署后通过 docker logs 容器ID 查看链接代理的方式。
多台服务器部署的话,可以通过haproxy配置负载均衡。
frontend mp-in
bind *:443
default_backend mp-out
backend mp-out
server ms3 IP1:443 check
server ms2 IP2:443 check
防火墙需要放行443端口
include rewrite/none.conf;
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php/$1 last;
}
}
include enable-php-pathinfo.conf;