机器学习常用Python库安装
机器学习常用Python库安装
作者 | 日期 | 版本 | 说明 |
---|---|---|---|
Dog Tao | 2022.06.16 | V1.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/
国内镜像源举例:
- 清华源
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/
- 中科大源
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/
- 北京外国语大学源
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/
- 上海交大源
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/
- 豆瓣源
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
国内镜像源举例:
-
阿里云 https://mirrors.aliyun.com/pypi/simple/
-
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
-
豆瓣 https://pypi.douban.com/simple
-
中国科学院 https://pypi.mirrors.opencas.cn/simple/
-
清华大学 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࿱…...

【Axure高保真原型】引导弹窗
今天和大家中分享引导弹窗的原型模板,载入页面后,会显示引导弹窗,适用于引导用户使用页面,点击完成后,会显示下一个引导弹窗,直至最后一个引导弹窗完成后进入首页。具体效果可以点击下方视频观看或打开下方…...

19c补丁后oracle属主变化,导致不能识别磁盘组
补丁后服务器重启,数据库再次无法启动 ORA01017: invalid username/password; logon denied Oracle 19c 在打上 19.23 或以上补丁版本后,存在与用户组权限相关的问题。具体表现为,Oracle 实例的运行用户(oracle)和集…...

深入剖析AI大模型:大模型时代的 Prompt 工程全解析
今天聊的内容,我认为是AI开发里面非常重要的内容。它在AI开发里无处不在,当你对 AI 助手说 "用李白的风格写一首关于人工智能的诗",或者让翻译模型 "将这段合同翻译成商务日语" 时,输入的这句话就是 Prompt。…...

Appium+python自动化(十六)- ADB命令
简介 Android 调试桥(adb)是多种用途的工具,该工具可以帮助你你管理设备或模拟器 的状态。 adb ( Android Debug Bridge)是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利,如安装和调试…...

基于ASP.NET+ SQL Server实现(Web)医院信息管理系统
医院信息管理系统 1. 课程设计内容 在 visual studio 2017 平台上,开发一个“医院信息管理系统”Web 程序。 2. 课程设计目的 综合运用 c#.net 知识,在 vs 2017 平台上,进行 ASP.NET 应用程序和简易网站的开发;初步熟悉开发一…...
解锁数据库简洁之道:FastAPI与SQLModel实战指南
在构建现代Web应用程序时,与数据库的交互无疑是核心环节。虽然传统的数据库操作方式(如直接编写SQL语句与psycopg2交互)赋予了我们精细的控制权,但在面对日益复杂的业务逻辑和快速迭代的需求时,这种方式的开发效率和可…...

屋顶变身“发电站” ,中天合创屋面分布式光伏发电项目顺利并网!
5月28日,中天合创屋面分布式光伏发电项目顺利并网发电,该项目位于内蒙古自治区鄂尔多斯市乌审旗,项目利用中天合创聚乙烯、聚丙烯仓库屋面作为场地建设光伏电站,总装机容量为9.96MWp。 项目投运后,每年可节约标煤3670…...
ffmpeg(四):滤镜命令
FFmpeg 的滤镜命令是用于音视频处理中的强大工具,可以完成剪裁、缩放、加水印、调色、合成、旋转、模糊、叠加字幕等复杂的操作。其核心语法格式一般如下: ffmpeg -i input.mp4 -vf "滤镜参数" output.mp4或者带音频滤镜: ffmpeg…...
【C++从零实现Json-Rpc框架】第六弹 —— 服务端模块划分
一、项目背景回顾 前五弹完成了Json-Rpc协议解析、请求处理、客户端调用等基础模块搭建。 本弹重点聚焦于服务端的模块划分与架构设计,提升代码结构的可维护性与扩展性。 二、服务端模块设计目标 高内聚低耦合:各模块职责清晰,便于独立开发…...

Redis数据倾斜问题解决
Redis 数据倾斜问题解析与解决方案 什么是 Redis 数据倾斜 Redis 数据倾斜指的是在 Redis 集群中,部分节点存储的数据量或访问量远高于其他节点,导致这些节点负载过高,影响整体性能。 数据倾斜的主要表现 部分节点内存使用率远高于其他节…...