第一节 python环境安装和包管理器

miniconda的安装和python环境搭建 文章目录前言下载minianaconda安装和配置安装注意配置更改镜像源创建虚拟环境和激活 前言 最近想用python去写一个写ini配置文件的工具,由于电脑现在的环境是python2的,想用python3的环境,又不想改变目前的环境,就准备重新安装一下anaconda。这篇博文记录一下,免得总是忘记。 向我这样只是用python写写小脚本,推荐安装miniconda,而不是anaconda,因为很多包用不上。具体选择,可参考官方文档Anaconda or Miniconda? 对于pip、conda、a 阅读详情

Anaconda概述

Anaconda安装

Conda的包管理器

Conda的环境管理

创建一个名为python34的环境,指定Python版本是3.4(不用管是3.4.x,conda会为我们自动寻找3.4.x中的最新版本

conda create --name python34 python=3.4

安装好后,使用activate激活某个环境

activate python34 # for Windows
source activate python34 # for Linux & Mac

激活后,会发现terminal输入的地方多了python34的字样,实际上,此时系统做的事情就是把默认2.7环境从PATH中去除,再把3.4对应的命令加入PATH

**此时,再次输入
python –version**
可以得到Python 3.4.5 :: Anaconda 4.1.1 (64-bit),即系统已经切换到了3.4的环境

如果想返回默认的python 2.7环境,运行

deactivate python34 # for Windows
source deactivate python34 # for Linux & Mac

删除一个已有的环境
conda remove –name python34 –all

Conda的包管理
# 安装scipy
conda install scipy
# conda会从从远程搜索scipy的相关信息和依赖项目,对于python 3.4,conda会同时安装numpy和mkl(运算加速的库)

# 查看已经安装的packages
conda list
# 最新版的conda是从site-packages文件夹中搜索已经安装的包,不依赖于pip,因此可以显示出通过各种方式安装的包

# 查看当前环境下已安装的包
conda list

# 查看某个指定环境的已安装包
conda list -n python34

# 查找package信息
conda search numpy

# 安装package
conda install -n python34 numpy
# 如果不用-n指定环境名称,则被安装在当前活跃环境
# 也可以通过-c指定通过某个channel安装

# 更新package
conda update -n python34 numpy

# 删除package
conda remove -n python34 numpy

conda将conda、python等都视为package,因此,完全可以使用conda来管理conda和python的版本

# 更新conda,保持conda最新
conda update conda

# 更新anaconda
conda update anaconda

# 更新python
conda update python
# 假设当前环境是python 3.4, conda会将python升级为3.4.x系列的当前最新版本

运行conda create -n python34 python=3.4之后,conda仅安装python 3.4相关的必须项.

# 在当前环境下安装anaconda包集合
conda install anaconda

# 结合创建环境的命令,以上操作可以合并为
conda create -n python34 python=3.4 anaconda
# 也可以不用全部安装,根据需求安装自己需要的package即可

设置国内镜像

# 添加Anaconda的TUNA镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# TUNA的help中镜像地址加有引号,需要去掉

# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
✨Windows 下超快 Python 包管理器 `uv` 安装教程(附图文详解) uv是由Astralpip(安装依赖)(创建虚拟环境)pip-tools(生成 requirements.txt)并做到更快、更简单!功能状态替代✅ 安装依赖完全支持pip✅ 创建虚拟环境内置支持✅ 生成锁文件支持 pyproject.toml / pylock.toml🚀 性能极快(Rust 编写)——优点描述⚡ 极快基于 Rust,10 倍 pip 安装速度🧹 干净默认不会污染全局环境🔒 安全自带锁文件生成📦 通用。 阅读详情

相关推荐

Python包管理器pip详解:从入门到精通

Python的包管理器pip是开发者必备的工具之一。本文将详细介绍pip的各种命令,从入门到精通,帮助读者掌握pip的使用技巧和高级功能。

全栈三维GIS开发工程师,擅长Cesium、OpenLayers、Three.js、WebGL、Vue、Django、GDAL和QGIS技术。在这个博客里,我将分享我的开发经验、技术心得和项目案例,希望能为GIS爱好者和开发者提供有价值的参考。 4464

python环境安装

打开cmd命令框,输入python,回车,如果出现python版本,代表安装成功。

sbdzqq123的博客 357

Python 入门:如何在 Linux 上安装 Python?

的文章,并发现了他可以使用 Python 创建和实现的所有令人惊奇的事物。了解如何在 Linux 上安装 Python 后,创建 Python 虚拟环境的方法有很多种。我们可以使用 git 从 Python 官方 GitHub 存储库克隆最新的 Python 源代码,在 Linux 上安装 Python。确保您已启用源列表中的源包。在本文中,您将通过安装适用于 Linux 的 Python 并与其交互,了解如何开始使用此。在这一步中,你必须让系统做它的事情并等待它在 Linux 上安装 Python。

新华编程特战队 4257

Python安装教程

第一步:下载Python安装包在Python的官网 www.python.org 中找到最新版本的Python安装包,点击进行下载,请注意,当你的电脑是32位的机器,请选择32位的安装包,如果是64位的,请选择64位的安装包;第二步:安装1)双击下载好的安装包,弹出如下界面:这里要注意的是,将python加入到windows的环境变量中,如果忘记打勾,则需要手工加到环境变量中;在这里我选择的是自定义安装,点击“自定义安装”进行下一步操作;

Python栈 7203

新一代Python包管理器UV应用指南

新一代Python包管理器五一劳动节发布!更多强大功能助力人工智能。

jackson_lingua的博客 2998

C# 【WebService编写调用】

😹 觉得博主文章写的不错的话,希望大家三连(✌关注,✌点赞,✌评论),多多支持一下!!!

只有登上山顶,才能看到那边的风光 1173

Python | 安装、环境配置及包的安装

Python的安装、环境配置及第三方库或模块的安装

跳动的喵尾巴 9489

假期搞定!2026国社科申报AI全攻略指南:从选题到创新,7大核心要点手把手教你!

最后给大家推荐的400多所高校教师都在用的AI平台——高级学术版专业应用平台,集成了国际主流学术应用,以及ChatGPT、Claude、Gemini、Grok等Al大模型的高级版本平台,还有,可以辅助大家高效完成科研和学术写作任务,当然撰写硕博论文,课题、职称论文、国社科、国自然基金本子也是手拿把掐。你的任务是:用高度凝练的方式说明在(某一明确国家战略 / 政策方向,如:中国式现代化、共同富裕、基层治理现代化、数字中国、文化强国、国家安全等)背景下,我究竟要研究一个什么“具体而可操作的问题”。

智能AI让学术科研更容易 624

2024最新Python下载安装环境配置教程(Windows系统+Mac系统)!附安装包

为了区分python解释器的版本,所以需要在指定文件夹下的python.exe复制一份副本并重新命名环境变量要看仔细,如果系统环境变量有,用户环境变量里面就删掉反之,系统环境变量里面有,用户环境变量就删掉环境变量,一般自己的电脑只有一个用户,如果有多个用户建议添加到系统环境变量。

m0_75067629的博客 1万+

ros入门(八)---TF坐标转换

TF(TransForm),就是坐标转换,包括了位置和姿态两个方面的变换。

weixin_51157015的博客 3388

QT入门开发一个时钟

本文讲述了时钟开发的具体过程以及代码。 涉及到一下几个知识点: 1. 定时器使用 2. 本地时间获取 3. resource资源读取 4. 图片绘制 5. 图片按照中心旋转 6. sin或者cos角度计算。

啊渊的专栏 5145

全网最详细的Python安装教程

首先要先下载安装包:①win7,win8,win10系统,建议下载python3.7.4版本:【直达链接】②win xp:建议下载 python 3.4.4版本【直达链接】Python安装包虽然版本不同,但安装过程其实都是差不多的。

2301_76161259的博客 2720

24、无人机能耗模型与上下文质量管理的研究

本文系统介绍了无人机能耗模型与上下文质量管理的研究进展。详细阐述了Dorling、Stolaroff、Kirchstein和Tseng等经典能耗模型的原理及特点,并基于LSTM架构构建了数据驱动的能耗预测模型,实验表明其预测精度显著优于传统模型。此外,还探讨了物联网环境中的上下文质量管理问题,引入了conQeng框架,以提升上下文选择、测量和验证的效率与可靠性。研究为无人机能耗优化和物联网上下文管理提供了理论支持和技术方案。

palm99的专栏 344

什么是 Python 包管理器?怎么安装?

Python 包管理器是一个用于安装、升级、卸载和管理 Python 包的工具。Python 的包(也称为模块或库)是预编写的 Python 代码,用于执行各种任务,如数据处理、网页开发、科学计算等。Python 包管理器使得这些包的管理变得简单和高效。在 Python 中,最常用的包管理器是pip(pip installs packages),它是 Python 官方推荐的包管理工具。通过pip。

weixin_46123033的博客 2162

基于FFT+BP神经网络/决策树的轴承故障诊断

基于FFT+BP神经网络/决策树的轴承故障诊断

天天酷科研的博客 131

基于STM32的智能快递柜设计(全部资料)

本文设计了一种基于STM32F407ZGT6的智能快递柜系统,通过模块化硬件设计和软件算法优化,实现了24小时无人值守、温湿度智能调控、远程监控等功能。系统集成OLED显示、GSM通信、舵机控制、超声波检测等模块,存取响应时间≤3秒,识别准确率达99.2%,较传统模式效率提升60%。测试表明系统运行稳定,用户满意度达92%,具有成本低、安全性高、可扩展性强等特点,为智慧物流末端配送提供了创新解决方案。未来可引入AI算法、太阳能供电等功能进一步优化系统性能。

3254968421的博客 586

Python使用-Python环境安装

Python使用-Python环境安装

xianzuzhicai的博客 8061

把 SAP Fiori Launchpad Designer 的 Catalog 与 Group 传输讲透:从 CONF、CUST 到 Transport Request 的完整理解

SAP Fiori项目中,catalog和group的传输问题往往源于对FLPD层次模型的理解不足。FLPD包含configuration(系统级)和customizing(客户端级)两个层面,分别对应workbench request和customizing request传输方式。常见误区包括:混淆/UI2/FLPD_CONF和/UI2/FLPD_CUST入口、未提前创建传输请求、不了解层次覆盖机制(customizing会覆盖configuration)。当客户端修改configuration层的对象

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 101

Python环境包管理器:Anaconda和pip哪个更适合你?

Python环境包管理器是指在Python开发过程中,用于安装、更新、卸载和管理软件包的工具。它们可以帮助开发者更方便地管理Python环境下的各种库和框架。以下是常见的6个Python环境包管理器及使用案例:pip是Python的官方包管理器,它提供了简单易用的命令行界面,用于安装、更新和卸载Python包。使用pip,我们可以轻松地从Python Package Index(PyPI)安装各种第三方库,例如NumPy、Pandas等。例如,要安装NumPy库,可以使用以下命令: 要更新已安装的库,可以使

m0_59236127的博客 1847

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【python】conda和pip安装库之间的区别

conda 首先,conda是一个通用的包管理器,意思是什么语言的包都可以用其进行管理,自然也就包括Python了。在安装Anaconda或者Miniconda时,会对conda进行一同安装。其中Anaconda作为Python的发行版,相当于在Python的基础上自带了常用第三方库,而Miniconda则相当于是一个conda环境的安装程序,只包含了conda及其依赖项,这样就可以减少一些不需要的第三方库的安装,所以Miniconda所占用的空间很小。 pip Pip同conda一样,也是一个包管理器,并

敲代码的quant的博客 3万+

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Pip包管理器如何安装和管理Python包?

幸运的是,Python提供了一个名为Pip的包管理器,它大大简化了Python包的安装和管理。Pip是Python的包管理器,它允许你轻松地安装和管理Python包。使用Pip,你可以从Python Package Index (PyPI)下载和安装包,这是一个包含数千个Python包的公共仓库。在实际开发中,你可能会遇到需要在同一台机器上为不同的项目安装不同版本的包的情况。通过掌握Pip包管理器的使用,你可以更有效地管理你的Python项目中的依赖关系,并确保项目的可移植性和可重复性。

HunterLawrence的博客 1222

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

如何在 Linux 下安装Python环境的详细指南

本文详细介绍如何在Linux下安装和配置Python环境,包括使用包管理器安装、从源码编译安装,以及虚拟环境的管理方法。

2103

centos安装python环境

通过上述步骤,你可以在CentOS上安装并配置多个版本的Python环境。你可以选择通过包管理器快速安装,也可以通过pyenv来灵活管理多个版本。

2401_87017622的博客 2112

极简 UV 离线安装指南:无网环境也能快速部署 Python 包管理器

UV 的离线安装核心是「下载二进制包 → 解压 → 全局配置」,全程无需编译、无需联网,3 步即可完成部署,适合所有无网或内网环境。其不仅安装简单,还能高效管理本地 Python 包和虚拟环境,是无网场景下 Python 开发的理想工具。

weixin_41544125的博客 4685

【Python的安装和环境配置——详细介绍】

Python的安装和环境配置在不同的操作系统中会有所不同。下面我将介绍在Windows、macOS和Linux这三个主流操作系统上Python的安装和环境配置的基本步骤。

cz88888888666的博客 1426

20250802-Python包管理器“uv”安装及使用教程

本文介绍了Python超快包管理工具uv的安装与使用方法。uv是用Rust编写的包管理器,速度比pip快10倍以上,支持秒装软件包、一键创建虚拟环境和智能解决依赖冲突。文章详细讲解了Windows系统下的三种安装方式,并针对国内用户提供了离线安装方案。最后以VS Code为例,演示了从创建虚拟环境到安装依赖的全流程操作,包括修改pip镜像源等实用技巧。uv能显著提升Python开发效率,是pip的理想替代工具。

mengfan_1993的博客 3237
上一篇: 第八节 Java IO流
下一篇: 第二节 python语言基础
江城子_Lay
博客等级 码龄9年 19粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值