conda:一个当下最流行的Python虚拟环境工具!

Python 虚拟环境工具及使用总结 Miniconda 是Anaconda的一个轻量级版本,只包括conda和其依赖,其他包需要手动安装。的原理是基于 Python 的模块化机制,通过创建一个独立的 Python 环境来实现虚拟化。是一个创建隔离的Python环境的工具。它可以创建一个包含指定版本Python解释器的环境,并可以安装独立的库和依赖。conda是一个开源包管理系统和环境管理系统,可以用于安装、运行和升级包和它们的依赖。的一个扩展,提供了更易于管理虚拟环境的命令行工具。创建一个新的虚拟环境,myenv 是新虚拟环境的名称,如下, 阅读详情

在实际中,更为流行的是用Conda来管理Python环境。今天这篇文章就为大家介绍这方面的相关内容。

 

Conda环境

Conda简介

Conda是目前为止,最流行的Python软件包与管理环境。Conda分为 miniconda 与 anaconda两种。前者从名字上就能猜出是精简版,后者预装了很多常用的功能,但比较臃肿。实际工程中,一般都使用 miniconda,按需安装软件包,本文的下面篇幅也以 miniconda 为例进行说明。

Conda安装

首先利用wget下载安装脚本文件:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

如果速度较慢,可以换用axel或aria2c下载

利用chmod命令修改sh文件为可执行文件,然后运行安装脚本:

chmod 755 Miniconda3-latest-Linux-x86_64.sh
bash ./Miniconda3-latest-Linux-x86_64.sh

在出现的提示界面中,根据提示选择yes或no。一般来说,我们保持默认即可,但需要留意下最后一步会自动在.bashrc文件添加conda的PATH路径。如果conda的环境存在与你日常使用的程序有冲突的命令,就有可能会出现问题。

当然,还有一种方式是在添加PATH路径时选择no,然后在每次需要conda的时候手动找到conda下的active命令激活下。这种方式比较灵活,如果不嫌麻烦建议使用这种方式。

注意不要把激活conda与激活虚拟环境搞混。

Conda常用命令

在conda环境中,常用的命令格式为:

conda [命令 [参数]] 

包管理

与python -m pip list类似,conda可以列出当前环境下的所有包:

conda list

版本与升级

conda有一套特别的机制,用于管理和维护依赖库之间的关系。在不同版本的conda中,我们可以直接使用的Python与依赖库的版本都不同,为了确定当前使用的conda版本,可以运行以下命令:

conda --version
<
学习海康VisionMaster之圆查找 (1):ROI选中位置修正,并且修正信息需要选择刚刚创建的位置修正组件输出信息,这里的话后续的检测窗口一般都需要做这一步,因为大部分的应用场景都是需要用到实时跟踪的。圆查找模块是用于查找指定区域的圆,并且会输出该圆的相关参数信息,比如圆中心点,圆半径,圆是否存在等信息。7):剔除点数:和高级参数里面的剔除距离搭配使用的,就是过滤较远的边缘点,让拟合圆心出来的轮廓更加接近。中的圆查找,相当于就是拟合圆心,这个在视觉软件中的应用也是非常广泛的,通常用于定位,测量项目。 阅读详情

相关推荐

从零开始:手把手教你理解UBOOT的BL0、BL1、BL2启动流程

本文详细解析了嵌入式系统中UBOOT启动流程的核心三阶段:BL0、BL1和BL2。BL0作为芯片固化的ROM代码,负责最基础的硬件初始化和加载BL1;BL1(SPL)作为二级程序加载器,在SRAM中运行并初始化DRAM,为加载BL2铺路;BL2则是完整的UBOOT主体,运行于DRAM,负责最终的外设初始化和操作系统引导。文章通过代码示例和流程图,手把手教你理解从芯片上电到系统就绪的完整接力过程。

qsc901234567的博客 1142

CMOS传输门实战:如何用模拟开关优化你的电路设计(附常见问题排查)

本文深入探讨了CMOS传输门在电路设计中的实战应用与优化策略。文章从核心参数选型入手,详细分析了导通电阻、电荷注入等关键特性对电路性能的影响,并提供了多路复用器构建、精密电路应用等实战架构。同时,重点分享了PCB布局、电源去耦的工程细节,以及开关不导通、信号失真、高频性能不足等常见问题的系统性排查指南,旨在帮助硬件工程师充分发挥CMOS模拟开关的效能,提升电路设计的可靠性与精度。

js777的博客 450

【一步到位】Android Studio 实现安卓连接阿里云物联网云平台

最新版本目前是Android Studio Iguana | 2024.1.2,你可以到官网上去找之前的版本,手上有工作项目的不要去轻易尝试,说不定你就编译失败了,失败了也不要担心,解决就可以了。

m0_73799445的博客 1万+

大话西游2单机版V8一键架设教程:从下载到GM权限全流程(附仙玉修改技巧)

本文详细讲解了大话西游2单机版V8的一键架设全流程,包括环境准备、服务端配置、客户端安装及GM权限获取等关键步骤。特别提供了仙玉修改技巧和高级资源管理方法,帮助玩家快速搭建个性化游戏环境并掌握核心控制功能。教程涵盖Windows系统兼容性设置、常见问题解决方案以及数据备份策略,适合各类怀旧玩家和技术爱好者。

weixin_29254673的博客 1033

langchain4j+milvus实战

本文主要研究一下如何使用langchain4j来对接向量数据库milvus。

go4it 1471

EMC中的RE测试与整改

测试主要测试电子、电气设备或系统在正常工作时自身对外界的辐射干扰强度,包括来自电路板、机箱、电缆及连接线等所有部件的辐射骚扰。分为:磁场辐射和。其中后者较为应用普遍。测试频段根据不同标准要求不一致。手机测试的频段主要为30-1000MHZ。需要注意的是设备在进行RE测试时要求尽可能满配置,满负荷的运行。同时RE也是EMC中的难点。

学海无涯的专栏 1669

Android Activity面试题最全解析(5万字长文)

Intent是Android中用于启动活动、服务或广播的一种消息对象。它包含了一系列键值对数据,用于描述操作的目的以及需要传递的信息。IntentString:字符串intfloatlong:基本数据类型Parcelable:实现了Parcelable接口的对象:实现了接口的对象示例代码如下:Java深色版本1// 创建Intent并传递数据");67// 启动新的Activity是一个XML标签,用于定义ActivityService或可以响应的Intent类型。它包含了。

大模型大数据攻城狮的专栏 801

深度学习工具包 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")

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

IDEA的使用指南

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

上一篇: requests+正则表达式爬取猫眼电影TOP100!
下一篇: 自己动手写个"狗屁不通"文章生成器!输入标题即可生成文章!
PythonJavaPHP
博客等级 码龄7年 116粉丝 76原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值