Python-setup打包命令

一、setup.py文件的书写

这个资料有很多,不多赘述,setup 函数常用的参数如下:

  • 基础描述信息
    • name 包名称(起一个响亮的名字)
    • version (-V) 包版本
    • author 程序的作者
    • author_email 程序的作者的邮箱地址
    • maintainer 维护者
    • maintainer_email 维护者的邮箱地址
    • url 程序的官网地址
    • license 程序的授权信息
    • description 程序的简单描述
    • long_description 程序的详细描述
    • platforms 程序适用的软件平台列表
    • keywords 程序的关键字列表
    • classifiers 程序的所属分类列表
  • 包的进阶信息
    • packages 需要处理的包目录(包含__init__.py的文件夹),这里通常使用 find_packages(),它默认在和setup.py同一目录下搜索各个含有 __init__.py的包。
    • install_requires = ["requests"] 需要安装的依赖包。我们可以首先生成 requirements.txt 文件,接着使用生成的文件生成需要的参数。关于生成 requirements.txt 文件,可以参考Python自动生成requirements.txt文件。
    • include_package_data,引入非 Python 文件。默认情况下只会对 Python 源码进行打包,但是如果我们想要将其他静态文件,例如 css 文件,或是 qt 的一些 ui 文件打包进去,就需要使用这个参数。后面会有详细的介绍。
  • 制作命令行工具
    • entry_points 动态发现服务和插件,可以用来制作命令行工具。也就是我们可以通过一些简单的命令,来运行 Python 项目中的指定文件或是函数。下面会详细进行介绍。

更多参数可见:https://setuptools.readthedocs.io/en/latest/setuptools.html

二、setup.py 打包命令

setup.py打包命令各参数详解:
>> python setup.py --help-commands

  •   --python setup.py build     # 仅编译不安装
  •   --python setup.py install    #安装到python安装目录的lib下
  •   --python setup.py sdist      #生成压缩包(zip/tar.gz)
  •   --python setup.py bdist  #生成平台安装包
    •   --python setup.py bdist_wininst  #生成NT平台安装包(.exe)
    •   --python setup.py bdist_rpm #生成rpm包
    •   --python setup.py bdist_wheel 生成wheel包
  •   --python setup.py egg_info # 单独生成egg_info信息

接下来以bandit 1.7.6为例进行讲解 :

 egg-info目录是用于存储与Python包相关的元数据信息的目录。它通常位于包的顶级目录中,以”.egg-info”为后缀。egg-info目录中包含了一些文本文件,其中存储了包的名称、版本、作者、依赖项等重要信息。这些信息对于包的安装、发布和管理都是必要的。参考:Python Python包和egg-info目录|极客教程

目录: D:\MyPython\my_setup\bandit-1.7.6\bandit.egg-info

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2023/12/9     10:53              1 dependency_links.txt
-a----         2023/12/9     10:53           3822 entry_points.txt
-a----         2023/12/9     10:53              1 not-zip-safe
-a----         2023/12/9     10:53             47 pbr.json
-a----         2023/12/9     10:53           4885 PKG-INFO
-a----         2023/12/9     10:53            359 requires.txt
-a----         2023/12/9     10:53           8935 SOURCES.txt
-a----         2023/12/9     10:53              7 top_level.txt

其中,PKG-INFO文件存储了关于包的详细信息,如名称、版本、作者、许可证等。top_level.txt文件列出了包中的顶级模块。SOURCES.txt文件记录了包中包含的所有源代码文件。dependency_links.txt文件存储了与包相关的依赖项的URL链接。 

pbr 是一个管理 python setuptools 的工具库(为了方便使用setuptools),pbr 模块读入 setup.cfg 文件的信息,并且给 setuptools 中的 setup hook 函数填写默认参数,提供更加有意义的行为。pbr只需要最小化的setup.py 文件。参考:python包管理和pbr — W.Young

import setuptools

setuptools.setup(
    python_requires=">=3.8", setup_requires=["pbr>=2.0.0"], pbr=True
)

 package名称在setup.cfg中定义:

[metadata]
name = bandit

entry_points参数用来支持自动生成脚本,其值应该为是一个字典,从 entry_point 组名映射到一个表示 entry_point 的字符串或字符串列表:

[entry_points]
console_scripts = 
	bandit = bandit.cli.main:main
	bandit-config-generator = bandit.cli.config_generator:main
	bandit-baseline = bandit.cli.baseline:main
...

2.1 python setup.py build

build相当于把需要打包的文件先收集起来,如下,

PS D:\MyPython\my_setup\bandit-1.7.6> python setup.py build
running build
running build_py
creating build
creating build\lib
creating build\lib\bandit
creating build\lib\bandit\blacklists
copying bandit\blacklists\calls.py -> build\lib\bandit\blacklists
copying bandit\blacklists\imports.py -> build\lib\bandit\blacklists
copying bandit\blacklists\utils.py -> build\lib\bandit\blacklists
copying bandit\blacklists\__init__.py -> build\lib\bandit\blacklists
creating build\lib\bandit\core
copying bandit\core\blacklisting.py -> build\lib\bandit\core
copying bandit\core\config.py -> build\lib\bandit\core
copying bandit\core\constants.py -> build\lib\bandit\core
copying bandit\core\context.py -> build\lib\bandit\core
copying bandit\core\docs_utils.py -> build\lib\bandit\core
copying bandit\core\extension_loader.py -> build\lib\bandit\core
copying bandit\core\issue.py -> build\lib\bandit\core
copying bandit\core\manager.py -> build\lib\bandit\core
copying bandit\core\meta_ast.py -> build\lib\bandit\core
copying bandit\core\metrics.py -> build\lib\bandit\core
copying bandit\core\node_visitor.py -> build\lib\bandit\core
copying bandit\core\tester.py -> build\lib\bandit\core
copying bandit\core\test_properties.py -> build\lib\bandit\core
copying bandit\core\test_set.py -> build\lib\bandit\core
copying bandit\core\utils.py -> build\lib\bandit\core
copying bandit\core\__init__.py -> build\lib\bandit\core
creating build\lib\bandit\cli
copying bandit\cli\baseline.py -> build\lib\bandit\cli
copying bandit\cli\config_generator.py -> build\lib\bandit\cli
copying bandit\cli\main.py -> build\lib\bandit\cli
copying bandit\cli\__init__.py -> build\lib\bandit\cli
creating build\lib\bandit\plugins
copying bandit\plugins\app_debug.py -> build\lib\bandit\plugins
copying bandit\plugins\asserts.py -> build\lib\bandit\plugins
copying bandit\plugins\crypto_request_no_cert_validation.py -> build\lib\bandit\plugins
copying bandit\plugins\django_sql_injection.py -> build\lib\bandit\plugins
copying bandit\plugins\django_xss.py -> build\lib\bandit\plugins
copying bandit\plugins\exec.py -> build\lib\bandit\plugins
copying bandit\plugins\general_bad_file_permissions.py -> build\lib\bandit\plugins
copying bandit\plugins\general_bind_all_interfaces.py -> build\lib\bandit\plugins
copying bandit\plugins\general_hardcoded_password.py -> build\lib\bandit\plugins
copying bandit\plugins\general_hardcoded_tmp.py -> build\lib\bandit\plugins
copying bandit\plugins\hashlib_insecure_functions.py -> build\lib\bandit\plugins
copying bandit\plugins\injection_paramiko.py -> build\lib\bandit\plugins
copying bandit\plugins\injection_shell.py -> build\lib\bandit\plugins
copying bandit\plugins\injection_sql.py -> build\lib\bandit\plugins
copying bandit\plugins\injection_wildcard.py -> build\lib\bandit\plugins
copying bandit\plugins\insecure_ssl_tls.py -> build\lib\bandit\plugins
copying bandit\plugins\jinja2_templates.py -> build\lib\bandit\plugins
copying bandit\plugins\logging_config_insecure_listen.py -> build\lib\bandit\plugins
copying bandit\plugins\mako_templates.py -> build\lib\bandit\plugins
copying bandit\plugins\request_without_timeout.py -> build\lib\bandit\plugins
copying bandit\plugins\snmp_security_check.py -> build\lib\bandit\plugins
copying bandit\plugins\ssh_no_host_key_verification.py -> build\lib\bandit\plugins
copying bandit\plugins\tarfile_unsafe_members.py -> build\lib\bandit\plugins
copying bandit\plugins\try_except_continue.py -> build\lib\bandit\plugins
copying bandit\plugins\try_except_pass.py -> build\lib\bandit\plugins
copying bandit\plugins\weak_cryptographic_key.py -> build\lib\bandit\plugins
copying bandit\plugins\yaml_load.py -> build\lib\bandit\plugins
copying bandit\plugins\__init__.py -> build\lib\bandit\plugins
copying bandit\__init__.py -> build\lib\bandit
copying bandit\__main__.py -> build\lib\bandit
creating build\lib\bandit\formatters
copying bandit\formatters\csv.py -> build\lib\bandit\formatters
copying bandit\formatters\custom.py -> build\lib\bandit\formatters
copying bandit\formatters\html.py -> build\lib\bandit\formatters
copying bandit\formatters\json.py -> build\lib\bandit\formatters
copying bandit\formatters\screen.py -> build\lib\bandit\formatters
copying bandit\formatters\text.py -> build\lib\bandit\formatters
copying bandit\formatters\utils.py -> build\lib\bandit\formatters
copying bandit\formatters\xml.py -> build\lib\bandit\formatters
copying bandit\formatters\yaml.py -> build\lib\bandit\formatters
copying bandit\formatters\__init__.py -> build\lib\bandit\formatters
running egg_info
writing bandit.egg-info\PKG-INFO
writing dependency_links to bandit.egg-info\dependency_links.txt
writing entry points to bandit.egg-info\entry_points.txt
writing requirements to bandit.egg-info\requires.txt
writing top-level names to bandit.egg-info\top_level.txt
[pbr] Reusing existing SOURCES.txt

我们看到在同级目录下有个build目录生成,bandit-1.7.6\build\lib\bandit下就是源码文件。

目录: D:\MyPython\my_setup\bandit-1.7.6\build\lib\bandit

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/20     21:08                blacklists
d-----         2024/1/20     21:08                cli
d-----         2024/1/20     21:08                core
d-----         2024/1/20     21:08                formatters
d-----         2024/1/20     21:08                plugins
-a----         2023/12/9     10:53            632 __init__.py
-a----         2023/12/9     10:53            571 __main__.py

 执行如下命令查看所有命令;

python setup.py build --help

Options for 'build' command:

  •   --build-base (-b)  构建根目录
  •   --build-purelib    中间发行版的构建目录
  •   --build-platlib    特定发行版的构建目录
  •   --build-lib        所有发行版的构建目录(默认为构建purelib或构建platlib)
  •   --build-scripts    脚本的构建目录
  •   --build-temp (-t)  临时构建目录
  •   --plat-name (-p)   要生成的支持平台名称(默认值:win-amd64)
  •   --compiler (-c)    指定编译器类型
  •   --parallel (-j)    并行任务数
  •   --debug (-g)       使用调试信息编译扩展和库
  •   --force (-f)      强制构建所有内容(忽略文件时间戳)
  •   --executable (-e)  指定最终目标解释器路径(build.py)
  •   --help-compiler    列出可用的编译器:
    • --compiler=bcpp     Borland C++ Compiler
    •  --compiler=cygwin   Cygwin port of GNU C Compiler for Win32
    • --compiler=mingw32  Mingw32 port of GNU C Compiler for Win32
    •  --compiler=msvc     Microsoft Visual C++
    • --compiler=unix     standard UNIX-style compiler

1、指定构建根目录 --build-base

当前目录下生成了my_build的目录,里面是bandit的源码。

python setup.py build  --build-base my_build./my_build

目录: D:\MyPython\my_setup\bandit-1.7.6\output\lib\bandit

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/20     23:07                blacklists
d-----         2024/1/20     23:07                cli
d-----         2024/1/20     23:07                core
d-----         2024/1/20     23:07                formatters
d-----         2024/1/20     23:07                plugins
-a----         2023/12/9     10:53            632 __init__.py
-a----         2023/12/9     10:53            571 __main__.py

2、发行版的构建目录--build-lib        

注意多一层 lib目录,看着有点不舒服,可以通过--build-lib实现:

python setup.py build   --build-lib my_build

目录: D:\MyPython\my_setup\bandit-1.7.6\my_build

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/20     23:15                bandit

2.2 python setup.py install

install会将build/lib下的文件以及egg-info进行打包并进行二进制化成.egg文件,该文件在当前文件夹下的dist文件夹下,并且,会把这个egg文件复制到对应环境的site-packages包下面,此时可以直接import 这个egg中的内容,但是无法跳转,另外还会生成egg-info文件夹,里面就是一些文件:

执行如下命令查看所有命令:

 python setup.py install --help

Options for 'LocalInstall' command:

  •   --prefix                             installation prefix
  •   --exec-prefix                        (Unix only) prefix for platform-specific files
  •   --home                               (Unix only) home directory to install under
  •   --install-base                       base installation directory (instead of --prefix or --home)
  •   --install-platbase                   base installation directory for platform-specific files (instead of --exec-prefix or --home)
  •   --root                               install everything relative to this alternate root directory
  •   --install-purelib                    installation directory for pure Python module distributions
  •   --install-platlib                    installation directory for non-pure module distributions
  •   --install-lib                        installation directory for all module distributions (overrides --install-purelib and --install-platlib)
  •   --install-headers                    installation directory for C/C++ headers
  •   --install-scripts                    installation directory for Python scripts
  •   --install-data                       installation directory for data files
  •   --compile (-c)                       compile .py to .pyc [default]
  •   --no-compile                         don't compile .py files
  •   --optimize (-O)                      also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]
  •   --force (-f)                         force installation (overwrite any existing files)
  •   --skip-build                         skip rebuilding everything (for testing/debugging)
  •   --record                             filename in which to record list of installed files
  •   --user                               install in user site-package 'C:\Users\rnanprince\AppData\Roaming\Python\Python38\site-packages'
  •   --old-and-unmanageable               Try not to use this!
  •   --single-version-externally-managed  used by system package builders to create 'flat' eggs 

2.3 python setup.py sdist

python setup.py sdist不会生成build文件夹,只会生成dist和egg-info文件夹;但此时dist下面的不是egg文件,而是tar.gz文件,是一个打包文件,也是打包的相同的东西;

D:\MyPython\my_setup\bandit-1.7.6> ls .\dist\

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/20     23:38          98707 bandit-1.7.6.tar.gz

其余的格式:

python setup.py sdist --help-formats

List of available source distribution formats:
  --formats=bztar  bzip2'ed tar-file
  --formats=gztar  gzip'ed tar-file
  --formats=tar    uncompressed tar file
  --formats=xztar  xz'ed tar-file
  --formats=zip    ZIP file
  --formats=ztar   compressed tar file

 执行如下命令编译zip包:

python setup.py sdist --formats=zip

结果如下:

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/20     23:45         139518 bandit-1.7.6.zip

2.4 python setup.py bdist

网上说sdist和bdist的区别一个是源码包,一个是二进制包;这里看到,bdist会同时生成build,dist,egg-info文件夹,且dist下面也会生成tar.gz文件,但我们可以看到,sdist和bdist生成的两个tar.gz文件是不一样的。

1、python setup.py bdist

生成NT平台安装包(.zip)

python setup.py bdist

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/20     23:38          98707 bandit-1.7.6.tar.gz
-a----         2024/1/20     23:50         388251 bandit-1.7.6.win-amd64.zip
-a----         2024/1/20     23:45         139518 bandit-1.7.6.zip

具体参数:

List of available distribution formats:
  --formats=rpm      RPM distribution
  --formats=gztar    gzip'ed tar file
  --formats=bztar    bzip2'ed tar file
  --formats=xztar    xz'ed tar file
  --formats=ztar     compressed tar file
  --formats=tar      tar file
  --formats=wininst  Windows executable installer
  --formats=zip      ZIP file
  --formats=msi      Microsoft Installer
  --formats=egg      Python .egg file

 2、python setup.py bdist --formats=gztar

生成NT平台安装包(tar.gz)

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/20     23:38          98707 bandit-1.7.6.tar.gz
-a----         2024/1/20     23:57         295291 bandit-1.7.6.win-amd64.tar.gz
-a----         2024/1/20     23:50         388251 bandit-1.7.6.win-amd64.zip
-a----         2024/1/20     23:45         139518 bandit-1.7.6.zip

3、python setup.py bdist_wininst  

生成NT平台安装包(.exe)

python setup.py bdist_wininst

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/20     23:38          98707 bandit-1.7.6.tar.gz
-a----         2024/1/20     23:49         827272 bandit-1.7.6.win-amd64.exe
-a----         2024/1/20     23:57         295291 bandit-1.7.6.win-amd64.tar.gz
-a----         2024/1/20     23:50         388251 bandit-1.7.6.win-amd64.zip
-a----         2024/1/20     23:45         139518 bandit-1.7.6.zip

4、python setup.py bdist_rpm

生成rpm包:

python setup.py bdist_rpm

running bdist_rpm
error: don't know how to create RPM distributions on platform nt

出错了,再议再议。。。哈哈

5、python setup.py bdist_wheel

生成wheel包:

python setup.py bdist_wheel

目录: D:\MyPython\my_setup\bandit-1.7.6\dist

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/1/21      0:12         123459 bandit-1.7.6-py3-none-any.whl
-a----         2024/1/20     23:38          98707 bandit-1.7.6.tar.gz
-a----         2024/1/20     23:49         827272 bandit-1.7.6.win-amd64.exe
-a----         2024/1/20     23:57         295291 bandit-1.7.6.win-amd64.tar.gz
-a----         2024/1/20     23:50         388251 bandit-1.7.6.win-amd64.zip
-a----         2024/1/20     23:45         139518 bandit-1.7.6.zip

2.5 python setup.py egg_info

单独生成egg_info信息:

python setup.py egg_info

生成的目录还是原来的目录,如果想自定义目录呢?

Options for 'LocalEggInfo' command:
  --egg-base (-e)   directory containing .egg-info directories (default: top of the source tree)
  --tag-date (-d)   Add date stamp (e.g. 20050528) to version number
  --tag-build (-b)  Specify explicit tag to add to version number
  --no-date (-D)    Don't include date stamp [default]

 1、python setup.py egg_info --egg-base ./my_egg_info

目录: D:\MyPython\my_setup\bandit-1.7.6\my_egg_info

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/21      0:11                bandit.egg-info

2、 标记信息

--tag-build=NAME,-b NAME

将NAME附加到项目的版本字符串中。由于setuptools处理以字母“a”到“e”(如“alpha”、“beta”和“candidate”)开头的“预发布”版本后缀的方式,您通常希望使用“.build”或“.dev”这样的标记,因为这会导致版本号被认为低于项目的默认版本。(如果您想使版本号高于默认版本,您可以始终取消标记构建,然后使用以下一个或两个选项。)

如果在setup.cfg中设置了默认的构建标记,则可以在命令行中使用-b“”或--tag build=“”作为egg_info命令的参数来抑制它。

--tag-date,-d

在项目的版本号中添加一个格式为“-YYYYMMDD”(例如“-2005 0528”)的日期戳。

--no-date,-D

不要在版本号中包含日期戳。此选项包括在内,因此您可以覆盖setup.cfg中的默认设置。


参考:

  • python setup.py 浅析-腾讯云开发者社区-腾讯云
  • Python 库打包分发(setup.py 编写)简易指南
  • Python: Directory not found or invalid file type prevents data_files from copying in Python's setup.py
  • python包管理和pbr — W.Young
  • Python深入:setuptools进阶 - 我用python写Bug - 博客园
  • Python编程:entry_points将Python模块转变为命令行工具_python entry_points console_scripts-CSDN博客
  • Python打包分发工具setuptools简介 | 思诚之道
  • 如何使用setuptools和setup.py从包中排除单个文件-腾讯云开发者社区-腾讯云
  • 使用setuptools对Python进行打包分发 | 旅途札记
  • Python包管理工具setuptools之setup函数参数详解
  • Python Python包和egg-info目录|极客教程
  • Running setuptools commands - setuptools 69.0.3.post20240114 documentation
  • Python的setuptools详解【3】打包wheel并提交给pypi_python setup.py sdist bdist_wheel-CSDN博客
    https://www.cnblogs.com/skying555/p/5191503.html

  • python用spec打包 python setup打包_mob64ca14089531的技术博客_51CTO博客

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/337182.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Datawhale 强化学习笔记(三)基于策略梯度(policy-based)的算法

文章目录 参考基于价值函数的缺点策略梯度算法REINFORCE 算法策略梯度推导进阶策略函数的设计离散动作的策略函数连续动作的策略函数 参考 第九章 策略梯度 之前介绍的 DQN 算法属于基于价值(value-based)的算法,基于策略梯度的算法直接对策略本身进行优化。 将策…

Cortex-M3/M4内核中断及HAL库函数详解(1):中断相关寄存器

0 工具准备 Keil uVision5 Cortex M3权威指南(中文) Cortex M3与M4权威指南 stm32f407的HAL库工程 STM32F4xx中文参考手册 1 NVIC相关寄存器介绍 在Cortex-M3/M4内核上搭载了一个异常响应系统,支持为数众多的系统异常和外部中断。其中&#…

[AutoSar]BSW_OS 07 Autosar OS_时间保护

一、 目录 一、关键词平台说明一 时间保护的概念 关键词 嵌入式、C语言、autosar、OS、BSW 平台说明 项目ValueOSautosar OSautosar厂商vector &#xff0c;芯片厂商TI 英飞凌编程语言C&#xff0c;C编译器HighTec (GCC) >>>>>回到总目录<<<<<…

【设计模式】什么是外观模式并给出例子!

什么是外观模式&#xff1f; 外观模式是一种结构型设计模式&#xff0c;主要用于为复杂系统、库或框架提供一种简化的接口。这种模式通过定义一个包含单个方法的高级接口&#xff0c;来隐藏系统的复杂性&#xff0c;使得对外的API变得简洁并易于使用。 为什么要使用外观模式&a…

详解IPV6地址

华子目录 IPV6IPV4和IPV6的报头IPV6的地址组成IPV6地址写法IPV6地址分类单播地址多播地址IPV6下的组播MAC地址 协议ICMPV61.PMTU2.NDP3.前缀通告auto-config 配置静态RIPNGOSPFV3BGP4 解决IPV4和IPV6兼容问题 (共存问题)普通tunnel6to4 tunnel双栈 IPV6 特征&#xff08;升级点…

Lattice Diamond软件下载

Lattice Diamond软件官方下载方法 对于电子设计中的很多开发软件&#xff0c;下载渠道有很多&#xff0c;但是安装包的下载&#xff0c;任何时候在官网上都可以可靠的找到资源并进行下载&#xff0c;因此这里对Diamond软件的下载&#xff0c;介绍官网的下载方法。 1 Lattice官…

渣土车识别摄像机

渣土车识别摄像机是一种应用于城市管理和交通监控领域的先进技术设备。它通过摄像头实时捕捉道路上行驶的车辆画面&#xff0c;并利用先进的图像识别和算法分析技术对渣土车进行准确识别。渣土车识别摄像机的设计需要兼顾高清晰度、高速度、大容量等特点&#xff0c;以满足实际…

大数据导论(3)---大数据技术

文章目录 1. 大数据技术概述2. 数据采集与预处理2.1 数据采集2.2 预处理 3. 数据存储和管理3.1 分布式基础架构Hadoop3.2 分布式文件系统HDFS3.3 分布式数据库HBase3.4 非关系型数据库NoSQL 4. 数据可视化与保护 1. 大数据技术概述 大数据技术主要包括数据采集与预处理、数据存…

字节跳动 ByteHouse 云原生之路 – 计算存储分离与性能优化

01 起源 ByteHouse 的故事从字节跳动对于先进数据处理和分析的需求开始&#xff0c;这一需求随着公司业务规模的迅速扩张而日益增长&#xff0c;起源是对开源数据库管理系统 ClickHouse 的改造和增强。面对数据处理的高延迟、大规模数据操作的复杂性以及数据存储和处理成本的上…

Ubuntu 在更新内核后 Virtual Box 不能为虚拟电脑打开一个新任务

前言 我也不知道啥时候自动给我更新了内核&#xff0c;重启电脑之后我的内核升级成6.5.0-14-generic&#xff0c;导致Virtual Box无法找到内核文件。 解决方法 方法1 sudo apt update sudo apt install linux-headers-generic build-essential dkms sudo apt remove virtua…

go 语言爬虫库goquery介绍

文章目录 爬虫介绍goquery介绍利用NewDocumentFromReader方法获取主页信息Document介绍通过查询获取文章信息css选择器介绍goquery中的选择器获取主页中的文章链接 爬取总结 爬虫介绍 爬虫&#xff0c;又称网页抓取、网络蜘蛛或网络爬虫&#xff0c;是一种自动浏览互联网并从网…

推荐两个工具:DeepSpeed-FastGen和DataTrove

DeepSpeed-FastGen 通过 MII 和 DeepSpeed-Inference 加速LLM生成文本 仓库地址&#xff1a;https://github.com/microsoft/DeepSpeed/tree/master/blogs/deepspeed-fastgen GPT-4 和 LLaMA 等大型语言模型 (LLM) 已成为服务于各个级别的人工智能应用程序的主要工作负载。从一…

使用OpenCV绘制图形

使用OpenCV绘制图形 绘制黄色的线&#xff1a; # 绘制一个黑色的背景画布 canvas np.zeros((300, 300, 3), np.uint8) # 在画布上&#xff0c;绘制一条起点坐标为(150, 50)、终点坐标为(150, 250)&#xff0c;黄色的&#xff0c;线条宽度为20的线段 canvas cv2.line(canvas,…

网易真的大规模裁员吗?

关注卢松松&#xff0c;会经常给你分享一些我的经验和观点。 以前互联网公司裁员&#xff0c;大家不紧张&#xff0c;因为容易找工作&#xff0c;而现在不知道怎么回事&#xff0c;只要以提高某某公司裁员&#xff0c;这就能迅速登上热榜。 这不&#xff0c;最近网传网易裁员1…

web架构师编辑器内容-编辑器组件图层面板功能开发-锁定隐藏、键盘事件功能的开发

我们这一部分主要是对最右侧图层面板功能进行剖析&#xff0c;完成对应的功能的开发: 每个图层都对应编辑器上面的元素&#xff0c;有多少个元素就对应多少个图层&#xff0c;主要的功能如下&#xff1a; 锁定功能&#xff1a;点击锁定&#xff0c;在编辑器中没法编辑对应的组…

响应式Web开发项目教程(HTML5+CSS3+Bootstrap)第2版 例4-6 fieldset

代码 <!doctype html> <html> <head> <meta charset"utf-8"> <title>fieldset</title> </head><body> <form action"#"><fieldset><legend>学生信息</legend>姓名&#xff1a;&…

基于python旅游推荐系统 协同过滤算法 爬虫 Echarts可视化 Django框架(源码)✅

毕业设计&#xff1a;2023-2024年计算机专业毕业设计选题汇总&#xff08;建议收藏&#xff09; 毕业设计&#xff1a;2023-2024年最新最全计算机专业毕设选题推荐汇总 &#x1f345;感兴趣的可以先收藏起来&#xff0c;点赞、关注不迷路&#xff0c;大家在毕设选题&#xff…

2024年一整年的考试报名时间表不许再错过考试啦

每个大学生都不能错过的超全考试报名表&#xff01; 有了它谁还会再错过考试哇&#xff01;&#xff01;&#xff01; 1月报名 专转本考试 12月底-1月报名 卫生资格考试 1月中旬报名 教师资格证笔试 1月报名 各省省考 2月报名 医师资格考试 2月报名 初级高级会计 2月报名 计算机…

专业137总分439东南大学920专业基础综合考研经验电子信息与通信电路系统芯片

我本科是南京信息工程大学&#xff0c;今年报考东南大学信息学院&#xff0c;成功逆袭&#xff0c;专业137&#xff0c;政治69&#xff0c;英语86&#xff0c;数一147&#xff0c;总分439。以下总结了自己的复习心得和经验&#xff0c;希望对大家复习有一点帮助。啰嗦一句&…

NLP论文阅读记录 - 2021 | WOS 基于多头自注意力机制和指针网络的文本摘要

文章目录 前言0、论文摘要一、Introduction1.1目标问题1.2相关的尝试1.3本文贡献 二.问题定义和解决问题的假设问题定义解决问题的假设 三.本文方法3.1 总结为两阶段学习3.1.1 基础系统 3.2 重构文本摘要 四 实验效果4.1数据集4.2 对比模型4.3实施细节4.4评估指标4.5 实验结果4…
最新文章