python内网中如何pip install

简介: python内网中如何pip install

以往我们pip install都是有网络的情况下进行的,

但是如果没有网络我们怎么办,按照以下步骤操作即可:


首先在外网中我们都会pip install下载好想要的包

我们就可以在pycharm中使用包(以 faker 举例)

image.gif编辑

1. 在pycharm下方的Terminal中运行以下命令:

image.gif编辑

ps: 注意网上很多说用pip freeze>hello.txt 这个会出现包指向本地文件的情况,

     导致txt文件无法使用的情况。

    hello.txt 这个名字可以随便起

2.这时候在你执行pip命令的目录下回出现hello.txt文件,打开它

把其中pip setuptools wheel distribute 等原始包删掉,

或者你只保留你想要的包,比如我只想保留Faker,我就只留这一个

image.gif编辑

3.接着执行 :

image.gif编辑

同样会在执行pip的目录下生成一个packages文件夹,其中就是你想要的包

4.把hello.txt和packages包拷贝到只有内网的机器上(已经安装好python环境),在pycharm的Terminal执行

image.gif编辑这样你就可以引用包了,包的路径和文件的路径自己定义就好了

目录
相关文章
|
6天前
|
Python
超详细的Python中 pip 常用命令,值得收藏!
超详细的Python中 pip 常用命令,值得收藏!
10 0
|
7天前
|
安全 IDE 开发工具
Python——记录pip问题(解决下载慢、升级失败问题)
Python——记录pip问题(解决下载慢、升级失败问题)
32 1
|
3天前
|
Linux 网络安全 iOS开发
如何在Python中使用Pip换源
如何在Python中使用Pip换源
|
5天前
|
Linux iOS开发 MacOS
|
5天前
|
存储 Linux 网络安全
常用的 Python 工具:使用 virtualenv、使用 Pip 进行安装和管理包
常用的 Python 工具:使用 virtualenv、使用 Pip 进行安装和管理包
9 0
|
6天前
|
Python
Python——pip安装weditor失败
Python——pip安装weditor失败
14 0
|
13天前
|
Ubuntu Python
ubuntu build install python3.12 and config pip
ubuntu 编译安装 python ; 并配置 pip 仓库源
21 0
|
1月前
|
开发者 Python
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
|
1月前
|
Python
确保你已经安装了`python-barcode`库。如果没有,可以通过pip来安装:
确保你已经安装了`python-barcode`库。如果没有,可以通过pip来安装:
|
Linux Python
How to Install Python on Linux
Summary Hostmonster uses the preinstalled version of Python that ships with CentOS. Because of this it is often not the latest release. This article will explain how to install an updated v
1673 0