Anaconda 是一个开源的数据科学平台,它集成了 Python 编程语言以及许多常用的科学计算、数据分析和机器学习库。通过 Anaconda,您可以方便地管理 Python 环境和安装第三方库,同时还提供了 Jupyter Notebook 和其他一些工具来支持交互式编程和数据可视化。
因此,一般来说,如果您已经安装了 Anaconda,就意味着您已经拥有了一个完整的 Python 环境,不需要再单独安装 Python。您可以直接使用 Anaconda 自带的 Python 解释器进行开发和运行代码。

Anaconda安装方法

1、Anaconda官网下载点击进入Anaconda下载地址
2、下载安装,建议安装在D盘,例如D:\Anaconda
3、安装完成后这时CMD进入输入conda提示不是内部命令,是因为没有配置Anaconda环境变量的原因。配置过程如下 :

D:\anaconda
D:\anaconda\Scripts
D:\anaconda\Library\bin

在这里插入图片描述
4、配置完成后,在cmd里面输入conda 就会弹出正确的使用说明信息

C:\Users\Administrator>conda
usage: conda-script.py [-h] [-v] [--no-plugins] [-V] COMMAND ...

conda is a tool for managing and deploying applications, environments and packages.

options:
  -h, --help          Show this help message and exit.
  -v, --verbose       Can be used multiple times. Once for detailed output, twice for INFO
                      logging, thrice for DEBUG logging, four times for TRACE logging.
  --no-plugins        Disable all plugins that are not built into conda.
  -V, --version       Show the conda version number and exit.

commands:
  The following built-in and plugins subcommands are available.

  COMMAND
    activate          Activate a conda environment.
    build             Build conda packages from a conda recipe.
    clean             Remove unused packages and caches.
    commands          List all available conda subcommands (including those from plugins).
                      Generally only used by tab-completion.
    compare           Compare packages between conda environments.
    config            Modify configuration values in .condarc.
    content-trust     Signing and verification tools for Conda
    convert           Convert pure Python packages to other platforms (a.k.a., subdirs).
    create            Create a new conda environment from a list of specified packages.
    deactivate        Deactivate the current active conda environment.
    debug             Debug the build or test phases of conda recipes.
    develop           Install a Python package in 'development mode'. Similar to `pip install
                      --editable`.
    doctor            Display a health report for your environment.
    export            Export a given environment
    index             Update package index metadata files.
    info              Display information about current conda install.
    init              Initialize conda for shell interaction.
    inspect           Tools for inspecting conda packages.
    install           Install a list of packages into a specified conda environment.
    list              List installed packages in a conda environment.
    metapackage       Specialty tool for generating conda metapackage.
    notices           Retrieve latest channel notifications.
    pack              See `conda pack --help`.
    package           Create low-level conda packages. (EXPERIMENTAL)
    remove (uninstall)
                      Remove a list of packages from a specified conda environment.
    rename            Rename an existing environment.
    render            Expand a conda recipe into a platform-specific recipe.
    repo              See `conda repo --help`.
    repoquery         Advanced search for repodata.
    run               Run an executable in a conda environment.
    search            Search for packages and display associated information using the MatchSpec
                      format.
    server            See `conda server --help`.
    skeleton          Generate boilerplate conda recipes.
    token             See `conda token --help`.
    update (upgrade)  Update conda packages to the latest compatible version.

5、Anaconda安装完成后会有一个自带的一个终端使用,打开这个终端,输入conda查看版本,输入python查看版本,都出现版本信息说明安装成功。

6、安装完Anaconda后,需要创建一个虚拟环境来安装labelimg。打开Anaconda Prompt(即自带终端),输入以下命令:
conda create -n labelimg python=3.8
上述命令将创建一个名为labelimg的虚拟环境,并指定Python版本为3.8。可以根据自己的需求选择适当的Python版本。

提示:如果在标注图片出现闪退问题,是因为Python版本太新导致,解决办法是重新创建一下虚拟环境把python版本选择小一点,创建时,会提示移除旧环境,按提示输入命令就行,移除完成后再创建新环境:conda create -n labelimg python=3.8

7、创建虚拟环境后,我们需要激活它,以便在该环境中安装LabelImg。在Anaconda Prompt中输入以下命令:
conda activate labelimg
激活虚拟环境后,我们可以在该环境中安装所需的Python包。

8、在激活的虚拟环境中,我们可以使用pip命令安装LabelImg。在Anaconda Prompt中输入以下命令:
pip install labelimg
安装完成后,我们就可以在虚拟环境中使用LabelImg了。

9、打开LabelImg
安装完成后,我们可以在Anaconda Navigator中找到LabelImg,并启动它。也可以在命令行中输入以下命令来启动LabelImg:
labelimg

conda activate labelimg这个命令进入虚拟环境

要先进入虚拟环境后输入labelimg才能启动成功

启动后,LabelImg的界面将显示出来,我们就可以开始进行图像标注工作了。

Labelimg使用方法

点击进入MSDN的Labelimg使用教程

删除现有的虚拟环境conda remove -n name --all

1、先退出要删除的虚拟环境,也就是回到base中

conda deactivate 用这个命令回到base环境

2、 conda env list显示所有的虚拟环境名称和路径
3、 conda remove -n name --all把name换成要删除的环境名即可。

CUDA,Pytorch安装

1、先安装CUDA11.8,具体版本根据自己显卡型号来确定

2、再安装Pytorch,进入创建的虚拟环境后输入下面命令

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
上面命令可以在下面网址匹配对应的版本号
https://pytorch.org/

pytorch卸载

1、使用conda卸载Pytorch
conda uninstall pytorch
conda uninstall libtorch

2、使用pip卸载Pytorch
pip uninstall torch

Logo

欢迎来到由智源人工智能研究院发起的Triton中文社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐