当前位置: 首页 > news >正文

机器学习常用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

相关文章:

机器学习常用Python库安装

机器学习常用Python库安装 作者日期版本说明Dog Tao2022.06.16V1.0开始建立文档 文章目录 机器学习常用Python库安装Anaconda简介使用镜像源配置 Pip简介镜像源配置 CUDAPytorch安装旧版本 TensorFlowGPU支持说明 DGL简介安装DGLLife RDKitscikit-multilearn Anaconda 简介 …...

HTTP 劫持、DNS 劫持与 XSS

HTTP 劫持、DNS 劫持与 XSS http 劫持是指攻击者在客户端和服务器之间同时建立了连接通道,通过某种方式,让客户端请求发送到自己的服务器,然后自己就拥有了控制响应内容的能力,从而给客户端展示错误的信息,比如在页面中…...

bash引用-Quoting详细介绍

bash引用-Quoting详细介绍 概述 引用的字面意思就是,用引号括住一个字符串。这可以保护字符串中的特殊字符不被shell或shell脚本重新解释或扩展。(如果一个字有不同于其字面意思的解释,它就是“特殊的”。例如:星号*除了本身代表*号以外还表…...

powershell几句话设置环境变量

设置环境变量比较繁琐,现在用这段话,在powershell中就可以轻松完成。 $existingPath [Environment]::GetEnvironmentVariable("Path", "Machine") $newPath "C:\Your\Path\Here"if ($existingPath -split ";"…...

Javascript 数据结构[入门]

作者:20岁爱吃必胜客(坤制作人),近十年开发经验, 跨域学习者,目前于海外某世界知名高校就读计算机相关专业。荣誉:阿里云博客专家认证、腾讯开发者社区优质创作者,在CTF省赛校赛多次取得好成绩。…...

IO(JavaEE初阶系列8)

目录 前言: 1.文件 1.1认识文件 1.2结构和目录 1.3文件路径 1.4文本文件vs二进制文件 2.文件系统的操作 2.1Java中操作文件 2.2File概述 2.2.1构造File对象 2.2.2File中的一些方法 3.文件内容的操作 3.1字节流 3.1.1InPutStream的使用方法 3.1.2OutPu…...

React Native 样式表的基础知识

在 React Native 中我们要使用组件元素进行样式设置的话,我们需要使用StyleSheet组件才能制定样式。useColorScheme是为 APP 定义颜色主题的。在此笔记中我们只是简单做一个介绍和使用。 使用StyleSheet定义样式 当我们要使用StyleSheet的话,我们需要引…...

【JS 解构赋值】

JS 解构赋值是 ES6 中一种简洁、高效的赋值方式,它可以将数组和对象中的值拆分出来并赋值给变量。 解构赋值 解构数组解构对象嵌套解构结语 解构数组 解构数组时,需要使用方括号 [] 包围变量名,并用逗号 , 将变量名隔开。 let [a, b, c] …...

Vue3状态管理库Pinia——自定义持久化插件

个人简介 👀个人主页: 前端杂货铺 🙋‍♂️学习方向: 主攻前端方向,正逐渐往全干发展 📃个人状态: 研发工程师,现效力于中国工业软件事业 🚀人生格言: 积跬步…...

il汇编整数相加

在这里尝试了IL汇编字符串连接; IL汇编字符串连接_bcbobo21cn的博客-CSDN博客 下面来看一下IL汇编整数相加; 大概的看一下一些资料,下面语句, ldc.i4 20 ldc.i4 30 add 看上去像是,装载整数20到一个类似于…...

RabbitMQ 事务

事务简介 就像我们了解的MySQL中的事务一样,RabbiMQ的事务也具备原子性和一致性,并且RabbiMQ的事务是针对消息从生产者发送到RabbitMQ中提供的支持,因此不同事务可以同时给同一个队列发送信息。   可通过channel.txSelect,chann…...

vue前端 让年月日 加上23:59:59

yyyy/MM/dd HH:mm:ss 格式 // 获取 lateCreateTime 的原始时间戳 const timestamp new Date(this.queryAO.lateCreateTime).getTime();// 将时间戳转换为指定格式的字符串 const formattedDateTime new Date(timestamp).toLocaleString("zh-CN", {year: "num…...

【雕爷学编程】Arduino动手做(186)---WeMos ESP32开发板8

37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止37种的。鉴于本人手头积累了一些传感器和执行器模块,依照实践出真知(一定要动手做)的理念,以学习和交流为目的&#x…...

STM32--综述

文章目录 前言STM32简介STM32F103C8T6系统结构Keil软件安装注意事项新建工程操作流程 前言 本专栏将学习B站江协科技的STM32入门教程,通过自身理解和对老师的总结所写的博客专栏。 STM32简介 STM32是意法半导体(STMicroelectronics)公司推…...

Linux学习之sed、awk和vim的差异

sed、awk和vim都是编辑器,区别如下: vim是交互式,需要跟用户进行互动,而sed和awk是非交互式,只需要写好命令,不用跟用户进行互动就可以完成任务。 vim是文本编辑器,操作的时候会对整个文件编辑&…...

MacOS上配置docker国内镜像仓库地址

背景 docker官方镜像仓库网速较差,我们需要设置国内镜像服务 我的MacOS docker版本如下 设置docker国内镜像仓库地址 点击Settings点击Docker Engine修改配置文件,添加registry-mirrors {"builder": {"gc": {"defaultKeepS…...

全志F1C200S嵌入式驱动开发(soc系统集成)

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】 任何一个嵌入式设备都是由很多的子系统组成的。这里面有硬件、有软件,还可能有机械,并不一定就是大家看到的消费电子那样,即一个soc构成了所有的系统。现实情况是,要构建一个系…...

React路由5版本

什么是路由? 一个路由就是一个映射关系(key:value). 以下代码用的都是router5 通过 npm install react-router-dom5 下载 所有路由用到的东西都需要从react-router-dom中引入 import {BrowserRouter,Link,Route,NavLink,Redirect,withRouter} from react-router-dom 1. 路…...

6.4.3 1x1卷积层

特点:1x1卷积层相当于全连接层 作用:1x1卷积用于调整网络层的通道数量和控制模型复杂度 输入形状:(通道,行,列) (3,3,3) 卷积核形状:(输出通道,输入通道,行,列) (2,3,…...

[CKA]考试之检查可用节点数量

由于最新的CKA考试改版,不允许存储书签,本博客致力怎么一步步从官网把答案找到,如何修改把题做对,下面开始我们的 CKA之旅 题目为: Task 检查集群中有多少节点为Ready状态(不包括被打上 Taint&#xff1…...

IDEA运行Tomcat出现乱码问题解决汇总

最近正值期末周,有很多同学在写期末Java web作业时,运行tomcat出现乱码问题,经过多次解决与研究,我做了如下整理: 原因: IDEA本身编码与tomcat的编码与Windows编码不同导致,Windows 系统控制台…...

基于大模型的 UI 自动化系统

基于大模型的 UI 自动化系统 下面是一个完整的 Python 系统,利用大模型实现智能 UI 自动化,结合计算机视觉和自然语言处理技术,实现"看屏操作"的能力。 系统架构设计 #mermaid-svg-2gn2GRvh5WCP2ktF {font-family:"trebuchet ms",verdana,arial,sans-…...

Python实现prophet 理论及参数优化

文章目录 Prophet理论及模型参数介绍Python代码完整实现prophet 添加外部数据进行模型优化 之前初步学习prophet的时候,写过一篇简单实现,后期随着对该模型的深入研究,本次记录涉及到prophet 的公式以及参数调优,从公式可以更直观…...

srs linux

下载编译运行 git clone https:///ossrs/srs.git ./configure --h265on make 编译完成后即可启动SRS # 启动 ./objs/srs -c conf/srs.conf # 查看日志 tail -n 30 -f ./objs/srs.log 开放端口 默认RTMP接收推流端口是1935,SRS管理页面端口是8080,可…...

新能源汽车智慧充电桩管理方案:新能源充电桩散热问题及消防安全监管方案

随着新能源汽车的快速普及,充电桩作为核心配套设施,其安全性与可靠性备受关注。然而,在高温、高负荷运行环境下,充电桩的散热问题与消防安全隐患日益凸显,成为制约行业发展的关键瓶颈。 如何通过智慧化管理手段优化散…...

WordPress插件:AI多语言写作与智能配图、免费AI模型、SEO文章生成

厌倦手动写WordPress文章?AI自动生成,效率提升10倍! 支持多语言、自动配图、定时发布,让内容创作更轻松! AI内容生成 → 不想每天写文章?AI一键生成高质量内容!多语言支持 → 跨境电商必备&am…...

ardupilot 开发环境eclipse 中import 缺少C++

目录 文章目录 目录摘要1.修复过程摘要 本节主要解决ardupilot 开发环境eclipse 中import 缺少C++,无法导入ardupilot代码,会引起查看不方便的问题。如下图所示 1.修复过程 0.安装ubuntu 软件中自带的eclipse 1.打开eclipse—Help—install new software 2.在 Work with中…...

UR 协作机器人「三剑客」:精密轻量担当(UR7e)、全能协作主力(UR12e)、重型任务专家(UR15)

UR协作机器人正以其卓越性能在现代制造业自动化中扮演重要角色。UR7e、UR12e和UR15通过创新技术和精准设计满足了不同行业的多样化需求。其中,UR15以其速度、精度及人工智能准备能力成为自动化领域的重要突破。UR7e和UR12e则在负载规格和市场定位上不断优化&#xf…...

OpenLayers 分屏对比(地图联动)

注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key 地图分屏对比在WebGIS开发中是很常见的功能,和卷帘图层不一样的是,分屏对比是在各个地图中添加相同或者不同的图层进行对比查看。…...

有限自动机到正规文法转换器v1.0

1 项目简介 这是一个功能强大的有限自动机(Finite Automaton, FA)到正规文法(Regular Grammar)转换器,它配备了一个直观且完整的图形用户界面,使用户能够轻松地进行操作和观察。该程序基于编译原理中的经典…...