当前位置:网站首页>5 minutes to learn how to set up local pypi source
5 minutes to learn how to set up local pypi source
2022-06-10 04:21:00 【Python Institute】

Preface
Usually we are downloading python Tsinghua source or Alibaba source will be selected when packaging . But when our development environment cannot access the Internet , You need to build a private source . Today we will spend together 5 Minutes to learn how to build a local private source .
Tool selection
There are many ways to build local private sources , Including but not limited to pypiserver,pip2pi,bandsnatch, among pypiserver Minimum difficulty in getting started , Easy to use , Simple function . The latter two are suitable for building enterprise level sources , Because it has the function of automatically synchronizing packages .
Service establishment
download pypiserver
pip install pypiserver
Create package path
mkdir ~/packages
Start the service
PS C:\Users\admin> pypi-server.exe
127.0.0.1 - - [23/Jun/2021 10:44:49] "GET / HTTP/1.1" 200 1007
127.0.0.1 - - [23/Jun/2021 10:44:54] "GET /simple/ HTTP/1.1" 200 221
127.0.0.1 - - [23/Jun/2021 10:45:25] "POST /RPC2 HTTP/1.1" 200 509
see web page

Here we are , Service startup complete .
Preparation package
First , Let's switch to ~/packages Under the table of contents , Then put your own python Copy the package here , Or upload the downloaded package to this directory .
We choose to download directly from external sources .
Download the sample package
cd ~/packages
pip download -i https://pypi.tuna.tsinghua.edu.cn/simple simplejson
Search from local sources
PS C:\Users\admin\packages> pip search -i http://localhost:8080 simplejson
simplejson (3.17.2) - 3.17.2
PS C:\Users\admin\packages>
Installation package
Before the installation
PS C:\Users\admin\packages> pip show simplejson
WARNING: Package(s) not found: simplejson
PS C:\Users\admin\packages>
install
PS C:\Users\admin\packages> pip install -i http://localhost:8080/simple simplejson
Looking in indexes: http://localhost:8080/simple
Collecting simplejson
Downloading http://localhost:8080/packages/simplejson-3.17.2-cp37-cp37m-win_amd64.whl (73 kB)
|████████████████████████████████| 73 kB ...
Installing collected packages: simplejson
Successfully installed simplejson-3.17.2
PS C:\Users\admin\packages>
After installation
PS C:\Users\admin\packages> pip show simplejson
Name: simplejson
Version: 3.17.2
Summary: Simple, fast, extensible JSON encoder/decoder for Python
Home-page: https://github.com/simplejson/simplejson
Author: Bob Ippolito
Author-email: [email protected]
License: MIT License
Location: d:\python37\lib\site-packages
Requires:
Required-by:
PS C:\Users\admin\packages>
This place pypi The source construction is all over .
LinuxConstruction method andWindowsAlmost the same .
Tip
The source built in this test is only for development use , If you need to build an enterprise level private enterprise , The official source needs to be synchronized regularly , It is recommended that you use bandsnatch To set up .
That's all for today , Thank you for reading , We'll see you next .
End
Previous recommendation
Gevent | Use it asynchronously !
jenkinsclient | Easy to use jenkins client
PySimpleGUI Classic practice : How to read this Chinese character ?
Jmeter test TCP Million connections
use Python Operation profile , Super simple
FastApi-16- Page beautification -1
FastApi-17- Page beautification -2
Light up to see !
边栏推荐
- [in depth study of 4g/5g/6g topic -27]: 5g NR startup process 4.5 - RRC connection response message msg4, first scheduling of PUCCH uplink control channel, UCI and HARQ response
- Source code encryption software type analysis
- [understanding of opportunity -22]: Guiguzi - the art of closing Tibet. Collect your talents in time to protect yourself in the workplace, business and business activities
- [android l]seandrod security enhancement background summary and impact
- MySQL - Installation
- [从零开始学习FPGA编程-12]: 快速入门篇 - 操作步骤3(功能仿真)-1-Mentor HDL仿真工具modelsim SE 10.4简介与安装
- How to view Scala source code in idea
- [graduation project 2] intelligent range hood system based on stm32
- Today, 19:30 | graphics special session - Gao Lin's team from Institute of computing technology, Chinese Academy of Sciences
- [机缘参悟-20]:鬼谷子-捭阖篇-一开一合,一动一静,一张一弛谓之捭阖,职场应用。
猜你喜欢

How to view Scala source code in idea
![[科技特长-1]:科技特长生概述与优势](/img/f6/77fda73053ed4afefc8277e196c1a9.png)
[科技特长-1]:科技特长生概述与优势

Fastapi-14-file upload-2
![[科技特长-3]:中考科技特长生知多少](/img/a6/f0a2f8dafffa28d2b2d2cd0431b739.jpg)
[科技特长-3]:中考科技特长生知多少

FastApi-14-文件上传-2

I wrote getter and setter methods every day. I was impatient, so I used the artifact mapperstruct, and the crud efficiency was suddenly improved! (hard coding is preferred)

FastApi-16-页面美化-1

Comment écrire du Code Scala dans idea

What do you usually ask about "ALI / byte" automation test interview questions in large factories, as well as the skills and answers

分布式数据对象:超级终端的'全局变量'
随机推荐
Pytoch cpu/gpu installation method.
497. random points in non overlapping rectangles
Qpprogressbar+qpushbutton+qmainwindow+qtmer+ layout manager +qtextcodec+qtexttospeech in QT
91. 栅栏
91. fence
[enlightenment -18]: Confucianism, Buddhism and Taoism, different life stages, different choices
什么时候用@ComponentScan?与@MapperScan有什么区别?
Figure out the difference between firmware, driver and software
[深入研究4G/5G/6G专题-30]: 5G NR开机流程5.1 - 基站与核心网的连接(NG Setup Request、NG Setup Response)与消息详解。
[深入研究4G/5G/6G专题-27]: 5G NR开机流程4.5 - RRC连接应答消息MSG4、PUCCH上行控制信道首次调度、UCI与HARQ应答
[in depth study of 4g/5g/6g topic -28]: 5g NR startup process 4.6 - msg5 (rrcsetupcomplete) message scheduling
Use 80% of the charts to meet daily work, and use the remaining 20% of the charts to build core competitiveness!
As a software testing engineer, give advice to young people (Part 1)
Key points of engineering ethics examination for Postgraduates
How to view Scala source code in idea
[机缘参悟-22]:鬼谷子-闭藏之术,适时收藏自己的锋芒,在职场、商务、商业活动中保护自己
[cloud native | kubernetes] in depth understanding of pod (VI)
[understanding of opportunity -20]: Guiguzi - Manoeuvring chapter - one opening and one closing, one movement and one relaxation are called manoeuvring, which can be used in the workplace.
Final examination paper 2 of the first postgraduate course in Dialectics of nature
Getting started with JDBC example