本地pip 源搭建起来

时间:2023-09-24 20:45:56
pip install pip2pi
pip2tgz target_dir -r requirement.txt 下载想要的本地的py包
 /usr/local/python3/bin/dir2pi --normalize-package-names /home/data/python_packages/
pip install -i http://172.18.18.162:10086/simple/  numpy
nginx 的配置:
    server {
        listen 10086;
        server_name pypi;
        root /var/www/packages;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
        location / {
                autoindex on;
                autoindex_exact_size off;
                autoindex_localtime on;
                #limit_rate 200k;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }