资讯动态

Python项目配置前的准备工作

发布时间:2026/10/22 1:26:02 来源:尧图企业网站定制
Python项目配置前的准备工作安装miniconda推荐大家使用清华镜像下载的miniconda实测非常稳定记得安装的时候所有的对号都要选择上。https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py39_4.9.2-Windows-x86_64.exe现在完成之后直接命令行打开输入conda -V的指令观察是否能正确输出conda的版本号如果可以则说明没有问题。另外为了增加后面镜像下载的速度推荐大家配置国内的镜像。请执行下面的指令进行镜像的配置。conda config --remove-key channels conda config--addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config--addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config--addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ conda config--setshow_channel_urlsyespip configsetglobal.index-url https://pypi.tuna.tsinghua.edu.cn/simple安装社区版本的pycharm这里推荐大家安装社区版本的社区版本的功能已经非常强大并且完全免费。下载的地址在这里其他版本 - PyCharm下载之后直接安装即可。安装vs编译工具后期在进行一些库的安装的过程中可能出出现下面的错误。error: Microsoft Visual C 14.0 is required. Get it with Build Tools for Visual Studio:https://visualstudio.microsoft.com/downloads/ Tools:出现这样的错误表示你的代码缺乏c的编译工具因为部分库的底层实现逻辑是通过C来进行完成的所以为了避免出现这样的错误在前期的准备中我们需要从官网下载对应的库进行安装Microsoft C 生成工具 - Visual Studio下载之后双击进行安装你需要从列表中选择下面的部分注意这里的安装位置默认在c盘如果你的c盘没有足够的空间你一定要给他移动他其他的盘中。安装完成之后重启你的电脑即可。装字体文件可选另外很多小伙伴在跑yolo的时候会提示字体文件缺失虽然程序设置了自动下载但是因为国内的下载速度比较慢所以大家还是提前进行安装字体文件已经提前准备在了代码包中大家从字体文件的目录打开双击进行安装即可。没有字体包的小伙伴可以直接从本博客的资源链接中获取。一些常用的深度学习库的安装指令condainstallpytorch1.8.0 torchvision torchaudiocudatoolkit10.2# 注意这条命令指定Pytorch的版本和cuda的版本condainstallpytorch1.10.0 torchvision torchaudiocudatoolkit11.3# 30系列以上显卡gpu版本pytorch安装指令condainstallpytorch1.8.0torchvision0.9.0torchaudio0.8.0 cpuonly# CPU的小伙伴直接执行这条命令即可pipinstalltorch1.10.0torchvision0.11.0torchaudio0.10.0 pipinstalltorch1.8.0torchvision0.9.0torchaudio0.8.0 pipinstalltorch2.1.0torchvision0.16.0torchaudio2.1.0 condainstallpytorch2.1.0torchvision0.16.0torchaudio2.1.0-cpytorch pipinstalltorch2.1.0torchvision0.16.0torchaudio2.1.0 --index-url https://download.pytorch.org/whl/cpu更换配置文件可选# Ultralytics AGPL-3.0 License - https://ultralytics.com/license # Overview: # This pyproject.toml file manages the build, packaging, and distribution of the Ultralytics library. # It defines essential project metadata, dependencies, and settings used to develop and deploy the library. # Key Sections: # - [build-system]: Specifies the build requirements and backend (e.g., setuptools, wheel). # - [project]: Includes details like name, version, description, authors, dependencies and more. # - [project.optional-dependencies]: Provides additional, optional packages for extended features. # - [tool.*]: Configures settings for various tools (pytest, yapf, etc.) used in the project. # Installation: # The Ultralytics library can be installed using the command: pip install ultralytics # For development purposes, you can install the package in editable mode with: pip install -e . # This approach allows for real-time code modifications without the need for re-installation. # Documentation: # For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com [build-system] requires [setuptools70.0.0,82.0.1, wheel] build-backend setuptools.build_meta # Project settings ----------------------------------------------------------------------------------------------------- [project] name ultralytics dynamic [version] description Ultralytics YOLO for SOTA object detection, multi-object tracking, instance segmentation, pose estimation, classification, and oriented object detection. readme README.md requires-python 3.8 license { text AGPL-3.0 } keywords [machine-learning, deep-learning, computer-vision, ML, DL, AI, RT-DETR, SAM3, YOLO, YOLOv3, YOLOv5, YOLOv8, YOLO11, YOLO26, Platform, Ultralytics] authors [ { name Glenn Jocher, email glenn.jocherultralytics.com }, { name Jing Qiu, email jing.qiuultralytics.com }, ] maintainers [ { name Ultralytics, email helloultralytics.com }, ] classifiers [ Development Status :: 5 - Production/Stable, Intended Audience :: Developers, Intended Audience :: Education, Intended Audience :: Science/Research, License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3), Programming Language :: Python :: 3, Programming Language :: Python :: 3.8, Programming Language :: Python :: 3.9, Programming Language :: Python :: 3.10, Programming Language :: Python :: 3.11, Programming Language :: Python :: 3.12, Programming Language :: Python :: 3.13, Topic :: Software Development, Topic :: Scientific/Engineering, Topic :: Scientific/Engineering :: Artificial Intelligence, Topic :: Scientific/Engineering :: Image Recognition, Operating System :: POSIX :: Linux, Operating System :: MacOS, Operating System :: Microsoft :: Windows, ] # Required dependencies ------------------------------------------------------------------------------------------------ dependencies [ numpy1.23.0, matplotlib3.3.0, opencv-python4.6.0,!4.13.0.90, # 4.13.0.90 FIPS selftest crash https://github.com/ultralytics/ultralytics/issues/23373 pillow7.1.2, pyyaml5.3.1, requests2.23.0, torch1.8.0, torch1.8.0,!2.4.0; sys_platform win32, # Windows CPU errors w/ 2.4.0 https://github.com/ultralytics/ultralytics/issues/15049 torchvision0.9.0, psutil5.8.0, # system utilization polars0.20.0, nvidia-ml-py12.0.0, # NVIDIA GPU monitoring https://pypi.org/project/nvidia-ml-py ultralytics-thop2.0.18, # FLOPs computation https://github.com/ultralytics/thop ] # Optional dependencies ------------------------------------------------------------------------------------------------ [project.optional-dependencies] dev [ ipython, pytest, pytest-cov, pytest-xdist3.0.0, coverage[toml], zensical0.0.15; python_version 3.10, mkdocs-ultralytics-plugin0.2.5, # for meta descriptions and images, dates and authors minijinja2.0.0, # render docs macros without mkdocs-macros-plugin ] export-base [ onnx1.12.0; platform_system ! Darwin, # ONNX export onnx1.12.0,1.18.0; platform_system Darwin and python_version 3.13, # TF inference hanging on MacOS (tested up to onnx1.20.0) onnx1.20.0; platform_system Darwin and python_version 3.13, onnxslim0.1.82, # ONNX export validation and inference. Jetson jobs provide custom aarch64 onnxruntime-gpu wheels. onnxruntime1.20.0; python_version 3.11 and (platform_machine ! aarch64 or platform_system ! Linux), onnxruntime1.20.0; python_version 3.11, nncf2.14.0,3.0.0; python_version 3.9, # OpenVINO INT8 export openvino2024.0.0, # OpenVINO export packaging26.0; platform_machine aarch64 and platform_system Linux and python_version 3.9, # IMX export bug ] export-legacy-torch [ numpy2, setuptools81.0.0; python_version 3.9, # legacy torchs torch_version imports pkg_resources, removed in setuptools81 ] export-tensorflow [ numpy2.0.0; python_version 3.13, # TF 2.20 compatibility tensorflow2.0.0,2.19.0; python_version 3.13, # TF bug https://github.com/ultralytics/ultralytics/issues/5161 tensorflow2.19.0; python_version 3.13, ydf0.13.0; platform_machine ! aarch64 and python_version 3.12, # ydf0.13 has protobuf gencode 6.x but tensorflow2.19 requires protobuf6 googleapis-common-protos1.74.0; python_version 3.12, # 1.74.0 uses protobuf gencode 7.34.1, incompatible with tensorflow2.19 (protobuf6) and breaks ray[tune] import tensorstore0.1.63; platform_machine aarch64 and python_version 3.9, # for TF Raspberry Pi exports h5py!3.11.0; platform_machine aarch64, # fix h5py build issues due to missing aarch64 wheels in 3.11 release ] export-coreml [ numpy2.3.5; platform_system ! Windows and python_version 3.13, # pin until CoreML9.0 fixes numpy2.4 int() cast crash coremltools9.0; platform_system ! Windows and python_version 3.13, # CoreML supported on macOS and Linux scikit-learn1.3.2; platform_system ! Windows and python_version 3.13, # CoreML k-means quantization ] export-executorch [ executorch, torch2.12.0,2.13.0; platform_system Linux and platform_machine aarch64, numpy2.3.5, ] export-deepx [ dx_com, numpy2, ] export-litert [ # LiteRT export, Linux x86 and macOS (litert-torch trace ai-edge-litert/quantizer) litert-torch0.9.0; (platform_system Linux and platform_machine x86_64) or platform_system Darwin, ai-edge-litert2.1.4; (platform_system Linux and platform_machine x86_64) or platform_system Darwin, ai-edge-quantizer0.6.0; (platform_system Linux and platform_machine x86_64) or platform_system Darwin, ] export [ ultralytics[export-base], ultralytics[export-tensorflow], ultralytics[export-coreml], ultralytics[export-litert], # Raspberry Pi Python 3.11 ExecuTorch inference requires the last known-good Linux ARM64 Torch 2.12 stack. torch2.12.0,2.13.0; platform_system Linux and platform_machine aarch64 and python_version 3.11, ] solutions [ shapely2.0.0, # shapely for point and polygon data matching lap0.5.12, # for solution tracking linear assignment # CLIP for similarity search auto-installs on first use via ultralytics.nn.text_model (https://github.com/ultralytics/CLIP) streamlit1.51.0; python_version 3.10, # for live inference on web browser, i.e yolo streamlit-predict streamlit1.29.0,1.51.0; python_version 3.10 and (platform_machine ! aarch64 or platform_system ! Linux), flask3.0.1, # for similarity search solution ] logging [ wandb, # https://docs.ultralytics.com/integrations/weights-biases/ tensorboard, # https://docs.ultralytics.com/integrations/tensorboard/ mlflow, # https://docs.ultralytics.com/integrations/mlflow/ ] extra [ ipython, # interactive notebook albumentations1.4.6, # training augmentations faster-coco-eval1.6.7, # COCO mAP ] typing [ types-pillow, types-psutil, types-pyyaml, types-requests, types-shapely, ] [project.urls] Homepage https://ultralytics.com Source https://github.com/ultralytics/ultralytics Documentation https://docs.ultralytics.com Bug Reports https://github.com/ultralytics/ultralytics/issues Changelog https://github.com/ultralytics/ultralytics/releases [project.scripts] yolo ultralytics.cfg:entrypoint ultralytics ultralytics.cfg:entrypoint # Tools settings ------------------------------------------------------------------------------------------------------- [tool.setuptools] # configuration specific to the setuptools build backend. packages { find { where [.], include [ultralytics, ultralytics.*] } } # Tests included below for checking Conda builds in https://github.com/conda-forge/ultralytics-feedstock package-data { ultralytics [**/*.yaml, **/*.sh, ../tests/*.py], ultralytics.assets [*.jpg], ultralytics.solutions.templates [*.html]} [tool.setuptools.dynamic] version { attr ultralytics.__version__ } [tool.pytest.ini_options] addopts --doctest-modules --durations30 --coloryes markers [ slow: skip slow tests unless --slow is set, ] norecursedirs [.git, dist, build] [tool.coverage.run] source [ultralytics/] data_file tests/.coverage omit [ultralytics/utils/callbacks/*] [tool.isort] line_length 120 multi_line_output 0 [tool.yapf] based_on_style pep8 spaces_before_comment 2 column_limit 120 coalesce_brackets true spaces_around_power_operator true space_between_ending_comma_and_closing_bracket true split_before_closing_bracket false split_before_first_argument false [tool.ruff] line-length 120 [tool.ruff.format] docstring-code-format true [tool.ruff.lint.pydocstyle] convention google [tool.docformatter] wrap-summaries 120 wrap-descriptions 120 pre-summary-newline true close-quotes-on-newline true in-place true [tool.codespell] ignore-words-list grey,writeable,finalY,RepResNet,Idenfy,WIT,Smoot,EHR,ROUGE,ALS,iTerm,Carmel,FPR,Hach,Calle,ore,COO,MOT,crate,nd,ned,strack,dota,ane,segway,fo,gool,winn,commend,bloc,nam,afterall,skelton,goin,alls skip *.pt,*.pth,*.torchscript,*.onnx,*.tflite,*.pb,*.bin,*.param,*.mlmodel,*.engine,*.npy,*.data*,*.csv,*pnnx*,*venv*,*translat*,*lock*,__pycache__*,*.ico,*.jpg,*.png,*.webp,*.avif,*.mp4,*.mov,/runs,/.git,./docs/??/*.md,./docs/mkdocs_??.yml

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑