机器学习常用Python库安装

机器学习常用Python库安装

作者日期版本说明
Dog Tao2022.06.16V1.0开始建立文档

文章目录

  • 机器学习常用Python库安装
    • Anaconda
      • 简介
      • 使用
      • 镜像源配置
    • Pip
      • 简介
      • 镜像源配置
    • CUDA
    • Pytorch
      • 安装旧版本
    • TensorFlow
      • GPU支持说明
    • DGL
      • 简介
      • 安装
      • DGLLife
    • RDKit
    • scikit-multilearn

Anaconda

简介

Anaconda and Miniconda are distributions of Python and other packages for data science, while Conda is the package manager that installs, updates, and removes them. Anaconda includes hundreds of packages, while Miniconda includes only Conda and its dependencies. Conda can also access different channels, such as the main channel maintained by Anaconda and the conda-forge channel maintained by the package developers. Users can choose between Anaconda Navigator, a graphical user interface, or Conda, a command-line tool, to manage their environments and packages.

Conda官方网站:https://docs.conda.io/en/latest/

Conda is an open source package management system and environment management system that runs on Windows, macOS, and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language.

Conda as a package manager helps you find and install packages. If you need a package that requires a different version of Python, you do not need to switch to a different environment manager, because conda is also an environment manager. With just a few commands, you can set up a totally separate environment to run that different version of Python, while continuing to run your usual version of Python in your normal environment.

In its default configuration, conda can install and manage the thousand packages at repo.anaconda.com that are built, reviewed and maintained by Anaconda®.

Conda can be combined with continuous integration systems such as Travis CI and AppVeyor to provide frequent, automated testing of your code.

The conda package and environment manager is included in all versions of Anaconda and Miniconda.

Conda is also included in Anaconda Enterprise, which provides on-site enterprise package and environment management for Python, R, Node.js, Java and other application stacks. Conda is also available on conda-forge, a community channel. You may also get conda on PyPI, but that approach may not be as up to date.

Anaconda官方网站:https://www.anaconda.com/

Anaconda was founded in 2012 by Peter Wang and Travis Oliphant out of the need to bring Python into business data analytics, which was rapidly transforming as a result of emerging technology trends. Additionally, the open-source community lacked an entity that could organize and collectivize it to maximize its impact. Since that time, the Python ecosystem has significantly expanded, with Python being the most popular programming language used today. Alongside this expansion, Anaconda has provided value to students learning Python and data science, individual practitioners, small teams, and enterprise businesses. We aim to meet every user where they are in their data science journey. Anaconda now has over 300 full-time employees based in the United States, Canada, Germany, United Kingdom, Australia, India, and Japan. We are proud to serve over 35 million users worldwide.

在这里插入图片描述

使用

参考文档:Anaconda conda常用命令:从入门到精通

在anaconda官网搜索包:https://anaconda.org/

镜像源配置

参考文档:conda操作之更新源和删除源

  • 查看镜像源
conda config --show channels
  • 永久添加镜像源

使用conda config --add channels URL命令,以添加清华源为例:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  • 移除镜像源

使用conda config --remove channels URL命令,以移除清华源为例:

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  • 设置搜索时显示通道地址
conda config --set show_channel_urls yes
  • 临时指定使用某个镜像源下载

使用conda的参数-c指定镜像源的地址,例如想在清华镜像源下载opencv包:

conda install opencv -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

国内镜像源举例:

  1. 清华源
conda config --add channels  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  1. 中科大源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  1. 北京外国语大学源
conda config --add channels  https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
conda config --add channels  https://mirrors.bfsu.edu.cn/anaconda/pkgs/free
conda config --add channels  https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/
  1. 上海交大源
conda config --add channels  https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels  https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels  https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
  1. 豆瓣源
conda config --add channels https://pypi.doubanio.com/simple/

Pip

简介

官网:https://pypi.org/project/pip/

pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.

在这里插入图片描述

镜像源配置

参考文档:pip国内镜像源配置

pip官方软件源 https://pypi.python.org/simple

国内镜像源举例:

  1. 阿里云 https://mirrors.aliyun.com/pypi/simple/

  2. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

  3. 豆瓣 https://pypi.douban.com/simple

  4. 中国科学院 https://pypi.mirrors.opencas.cn/simple/

  5. 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

  • 临时指定使用某个镜像源下载

使用pip的参数-i指定镜像源的地址,例如想在阿里云镜像源下载Pillow包

pip install -i https://mirrors.aliyun.com/pypi/simple Pillow

CUDA

  • 显卡型号支持检查:https://developer.nvidia.com/cuda-gpus

  • Archived ReleasesCUDA Toolkit下载:https://developer.nvidia.com/cuda-toolkit-archive

  • 技术教程:https://blog.csdn.net/Mind_programmonkey/article/details/99688839

Pytorch

官方安装说明:https://pytorch.org/get-started/locally/

在这里插入图片描述

安装旧版本

Installing previous versions of PyTorch: https://pytorch.org/get-started/previous-versions/

以适配CUDA 11.3的版本为例:

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch

在这里插入图片描述

TensorFlow

官方安装说明:https://tensorflow.google.cn/install?hl=zh-cn

GPU支持说明

官方安装说明:https://tensorflow.google.cn/install/gpu?hl=zh-cn

DGL

简介

官网:https://www.dgl.ai/

In the last few years, deep learning has enjoyed plenty of extraordinary successes. Many challenging tasks have been solved or close to being solved by Deep Learning, such as image recognition, rich-resource machine translation, game playing. These were made possible by a set of techniques that are composed of a number of representationally powerful building-blocks, such as convolution, attention and recurrence, applied to images, video, text, speech and beyond.The development and deployment of these techniques often depend on the simple correlation of the given data; for example, CNN is based on the spatial correlation between nearby pixels while RNN family dwells on the assumption that its input is sequence-like.More recently, there has been a steady flow of new deep learning research focusing on graph-structured data. Some of them are more conventional graph related problems, like social networks, chemical molecules and recommender systems, where how the entity interacts with its neighborhood is as informative as, if not more than, the features of the entity itself.Some others nevertheless have applied graph neural networks to images, text or games. Very broadly speaking, any of the data structures we have covered so far can be formalized to graphs. For instance an image can be seen as grid of pixel, text a sequence of words… Together with matured recognition modules, graph can also be defined at higher abstraction level for these data: scene graphs of images or dependency trees of language.To this end, we made DGL. We are keen to bringing graphs closer to deep learning researchers. We want to make it easy to implement graph neural networks model family. We also want to make the combination of graph based modules and tensor based modules (PyTorch or MXNet) as smooth as possible.

在这里插入图片描述

安装

官方安装说明:https://www.dgl.ai/pages/start.html

以适配CUDA 11.3的版本为例:

# If you have installed dgl-cudaXX.X package, please uninstall it first.
conda install -c dglteam/label/cu113 dgl

在这里插入图片描述

DGLLife

DGL-LifeSci官网:https://lifesci.dgl.ai/index.html

DGL-LifeSci is a python package for applying graph neural networks to various tasks in chemistry and biology, on top of PyTorch, DGL, and RDKit. It covers various applications, including:

  • Molecular property prediction
  • Generative models
  • Reaction prediction
  • Protein-ligand binding affinity prediction

DGL-LifeSci is free software; you can redistribute it and/or modify it under the terms of the Apache License 2.0. We welcome contributions. Join us on GitHub.

  • 在anaconda官网搜索包:https://anaconda.org/
conda install -c conda-forge dgllife

在这里插入图片描述

RDKit

官网:https://rdkit.org/

RDKit documentation:https://rdkit.org/docs/index.html

conda install -c conda-forge rdkit
pip install rdkit

scikit-multilearn

官网:http://scikit.ml/

文档:http://scikit.ml/api/skmultilearn.html

源码:https://github.com/scikit-multilearn/scikit-multilearn

pip install scikit-multilearn

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

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

相关文章

英语使用场景口语

HOTEL ENGLISH hotel motel inn b&b Process 1.booking a room can i reserve a room? reservation do you have and singles? double room standard room deluxe room presidential suite do you have a pick-up service? 2.checking in where is the recept…

MySQL的数据插入总结(不存在就插入,存在就更新)

MySQL的数据插入总结(不存在就插入,存在就更新) 1. on duplicate key update 当在insert语句后面带上ON DUPLICATE KEY UPDATE 子句,而要插入的行与表中现有记录的惟一索引或主键中产生重复值,那么就会发生旧行的更新;如果插入的…

AI 绘画Stable Diffusion 研究(五)sd文生图功能详解(下)

大家好,我是风雨无阻。 上一篇文章详细介绍了sd文生图的功能及使用注意事项,感兴趣的朋友可以前往查看:AI 绘画Stable Diffusion 研究(四)sd文生图功能详解(上) 。 那今天这篇文章,我…

sigmoid ReLU 等激活函数总结

sigmoid ReLU sigoid和ReLU对比 1.sigmoid有梯度消失问题:当sigmoid的输出非常接近0或者1时,区域的梯度几乎为0,而ReLU在正区间的梯度总为1。如果Sigmoid没有正确初始化,它可能在正区间得到几乎为0的梯度。使模型无法有效训练。 …

【Github】Uptime Kuma:自托管监控工具的完美选择

简介: Uptime Kuma 是一款强大的自托管监控工具,通过简单的部署和配置,可以帮助你监控服务器、VPS 和其他网络服务的在线状态。相比于其他类似工具,Uptime Kuma 提供更多的灵活性和自由度。本文将介绍 Uptime Kuma 的功能、如何使…

C#--设计模式之单例模式

单例模式大概是所有设计模式中最简单的一种,如果在面试时被问及熟悉哪些设计模式,你可能第一个答的就是单例模式。 单例模式的实现分为两种: 饿汉式:在静态构造函数执行时就立即实例化。懒汉式:在程序执行过程中第一…

C++类的定义和对象的创建

一、问题引入 C类和对象到底是什么意思? 1、C 中的类(Class)可以看做C语言中结构体(Struct)的升级版。结构体是一种构造类型,可以包含若干成员变量,每个成员变量的类型可以不同; …

K8s的高可用搭建

高可用技术搭建 在master节点上需要部署:keepalived、haproxy

Linux 信号signal处理机制

Signal机制在Linux中是一个非常常用的进程间通信机制,很多人在使用的时候不会考虑该机制是具体如何实现的。signal机制可以被理解成进程的软中断,因此,在实时性方面还是相对比较高的。Linux中signal机制的模型可以采用下图进行描述。 每个进程…

openGauss学习笔记-33 openGauss 高级数据管理-视图

文章目录 openGauss学习笔记-33 openGauss 高级数据管理-视图33.1 语法格式33.2 参数说明33.3 示例 openGauss学习笔记-33 openGauss 高级数据管理-视图 视图与基本表不同,是一个虚拟的表。数据库中仅存放视图的定义,而不存放视图对应的数据&#xff0c…

Misc取证学习

文章目录 Misc取证学习磁盘取证工具veracryto挂载fat文件DiskGenius 磁盘取证例题[RCTF2019]disk 磁盘[](https://ciphersaw.me/ctf-wiki/misc/disk-memory/introduction/#_2)内存取证工具volatility 内存取证例题数字取证赛题0x01.从内存中获取到用户admin的密码并且破解密码 …

Maven: ‘mvn‘ is not recognized as an internal or external command

下载并配置好Maven之后,CMD测试安装是否成功:mvn -v 提示: mvn is not recognized as an internal or external command, operable program or batch file. 检查环境变量: MAVEN_HOME: %MAVEN_HOME%\bin: 看上去没问题&#x…

【Java】异常处理 之 Java的异常

Java的异常 在计算机程序运行的过程中,总是会出现各种各样的错误。 有一些错误是用户造成的,比如,希望用户输入一个int类型的年龄,但是用户的输入是abc: // 假设用户输入了abc: String s "abc&quo…

uniapp微信小程序底部弹窗自定义组件

基础弹窗效果组件 <template><view><viewclass"tui-actionsheet-class tui-actionsheet":class"[show ? tui-actionsheet-show : ]"><view class"regional-selection">底部弹窗</view></view><!-- 遮罩…

行业追踪,2023-08-07

自动复盘 2023-08-07 凡所有相&#xff0c;皆是虚妄。若见诸相非相&#xff0c;即见如来。 k 线图是最好的老师&#xff0c;每天持续发布板块的rps排名&#xff0c;追踪板块&#xff0c;板块来开仓&#xff0c;板块去清仓&#xff0c;丢弃自以为是的想法&#xff0c;板块去留让…

el-popover使用自定义图标

使用el-popover实现鼠标点击或浮动到自定义图标上弹出表格弹窗&#xff0c;官方文档上使用的是按钮el-button&#xff0c;如果想换成图标或其他的组件的话直接把el-button替换掉即可。注意替换之后的组件一定要加slot“reference”&#xff0c;不然组件是显示不出来的。 代码如…

前端小练习:案例5.律动爱心

目录 一.效果预览图 二.实现思路 ​编辑 1.html部分 2.css部分 三.完整代码 一.效果预览图 二.实现思路 想要实现爱心律动效果并不难&#xff0c;核心点是关键帧动画。 定义律动爱心需要的元素块&#xff0c;使用定位或者弹性布局等方法&#xff08;定位元素不适合布局&…

zookeeper和kafka

目录 一、zookeeper理论 1.1、zookeeper定义 1.2、zookeeper工作机制 1.3、zookeeper特点 1.4、zookeeper的数据结构 1.5、zookeeper应用场景 1.6、zookeeper的选举机制 二、部署Zookeeper 集群 2.1、环境准备 2.2、安装 Zookeeper 2.3、修改配置文件 2.4、配置…

百度智能创做AI平台

家人们好&#xff0c;在数字化时代&#xff0c;人工智能正引领着一场前所未有的创新浪潮。今天&#xff0c;我们将为大家介绍百度智能创做AI平台&#xff0c;这个为创意赋能、助力创作者的强大工具。无论你是创意工作者、内容创作者&#xff0c;还是想要释放内心创造力的个人&a…

Linux下进程的特点与环境变量

目录 进程的特点 进程特点的介绍 进程时如何实现并发性的 进程间如何切换 概念铺设 PC指针 上下文 环境变量 PATH 修改PATH HOME SHELL env 命令行参数 什么是命令行参数&#xff1f; 打印命令行参数 通过函数获得环境变量 getenv 命令行参数 env 修改环境变…