一、安装pip2pi工具:
pip install pip2pi
或:
git clone https://github.com/wolever/pip2pi cd pip2pi python setup.py install
二、创建存放软件包的仓库:
mkdir /opt/python/soft/pypi.jb51.net
三、下载软件包并建立索引:
单独下载某个软件包
pip2tgz /opt/python/soft/pypi.jb51.net/ routes==1.12.3
批量下载软件包:
pip2tgz /opt/python/soft/pypi.jb51.net/ -r list/requirements.txt
建立索引:
dir2pi /opt/python/soft/pypi.jb51.net/
更新索引:
pip2acmeco uliweb=0.2.6 pip2acmeco -r list/requirements.txt
四、结合nginx配置web端:
Nginx服务器添加虚拟主机配置:
server { listen 80; server_name pypi.jb51.net; root /opt/python/soft/pypi.jb51.net; location /{ autoindex on; autoindex_exact_size off; #显示文件的大小 autoindex_localtime on; #显示文件时间 #limit_rate_after 5m; #5分钟后下载速度限制为200k limit_rate 200k; } access_log logs/pypi.jb51.net.access.log main; }
至此已经配置完了自己的私有pypi了 需要什么软件包的时候,自己拿到放到自己的pypi里面就可以了;
同理也可以把自己的项目打包放进去。
五、如何更好的使用pypi源:
打个比方安装下uliweb吧
pip install --index-url=http://pypi.jb51.net/simple/ uliweb
或者
pip install -i uliweb
这样是不是很麻烦,想不想默认就走自己的pypi源? 好吧,这里已经给你想好了一个方法啦:
在linux下创建~/.pip/pip.conf文件,文件内容如下
[global] index-url = http://pypi.jb51.net/simple
如果是windows环境,创建:%HOMEPATH%\pip\pip.ini
内容和上面linux下一样.
同时推荐几个比较好的国内pypi源:
http://pypi.douban.com 豆瓣 http://pypi.hustunique.com 华中理工大学 http://pypi.sdutlinux.org 山东理工大学 http://pypi.mirrors.ustc.edu.cn 中国科学技术大学
PS:修改easy_install和pip使用的源有两种方式
(以Linux上从镜像源e.pypi.python.org下载安装requests为例):
命令方式:针对一次使用,临时修改
easy_install
easy_install -i http://e.pypi.python.org/simple requests
pip
pip install requests -i http://e.pypi.python.org/simple
注:1. 源路径要包含/simple部分;2. 使用pip时-i参数应放在install xxx的后面
修改(若没有,则创建)easy_install/pip的配置文件
easy_install:在~/.pydistutils.cfg配置文件中写入如下内容:
[easy_install] index_url = http://e.pypi.python.org/simple
pip:在~/.pip/pip.conf配置文件中写入:
[global] index-url = http://e.pypi.python.org/simple

本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于Seaborn的相关问题,包括了数据可视化处理的散点图、折线图、条形图等等内容,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于进程池与进程锁的相关问题,包括进程池的创建模块,进程池函数等等内容,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于简历筛选的相关问题,包括了定义 ReadDoc 类用以读取 word 文件以及定义 search_word 函数用以筛选的相关内容,下面一起来看一下,希望对大家有帮助。

VS Code的确是一款非常热门、有强大用户基础的一款开发工具。本文给大家介绍一下10款高效、好用的插件,能够让原本单薄的VS Code如虎添翼,开发效率顿时提升到一个新的阶段。

本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于数据类型之字符串、数字的相关问题,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于Python的相关知识,其中主要介绍了关于numpy模块的相关问题,Numpy是Numerical Python extensions的缩写,字面意思是Python数值计算扩展,下面一起来看一下,希望对大家有帮助。

pythn的中文意思是巨蟒、蟒蛇。1989年圣诞节期间,Guido van Rossum在家闲的没事干,为了跟朋友庆祝圣诞节,决定发明一种全新的脚本语言。他很喜欢一个肥皂剧叫Monty Python,所以便把这门语言叫做python。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment
