conda虚拟环境 | install 与 list 问题

  1. conda 创建虚拟环境,此时,conda list为空, pip list 为本机pip list

2.

conda install python=3.9

之后 ,pip list 与conda list相同,均为python与相关依赖包

3.

conda install fake-useragent==0.1.11

conda 可以安装anaconda上拥有的包(大约有一千多个) ,但是有些包anaconda不存在,以fake-useragent(0.1.11)为例

若安装会出现:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - fake-useragent==0.1.11

Current channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

所以此时我们想用pip install

pip install  fake-useragent=0.1.11

pip安装没有的包

安装后,打开conda list 与pip list

我们会发现,两个list之中均与该包

截图如下:

conda虚拟环境 | install 与 list 问题

conda list: fake-useragent 在最底下

conda虚拟环境 | install 与 list 问题

pip list: fake-useragent 在最底下

若是使用conda install 安装的包,则同样 在两个list中均存在

  1. 我们在该虚拟环境下import 用 pip install 的包,可以成功的import

conda虚拟环境 | install 与 list 问题

总结:

pip install 可以安装anaconda没有的包,包同时在两个list中出现,而且在虚拟环境中可以正常import。

conda 虚拟环境中,pip list 确实是 conda list 的真子集。

Original: https://blog.csdn.net/m0_60235585/article/details/125794763
Author: 钠文
Title: conda虚拟环境 | install 与 list 问题



相关阅读

Title: Argo CD系列视频图文版之自建应用模拟开发场景

开篇

本期视频,我们来动手自建一个应用,模拟实际的场景。通过这个场景模拟,各位可以感受到真正生产环境中应该怎样使用 ArgoCD。我们的项目托管在 Github,留作给大家作为参考材料。

argocd in action[1]

配套视频

flask demo

flask demo 目录用来模拟代码仓库,它是一个典型极简的 Flask 项目,主要功能就是输出数据库连接的环境变量到前端页面。

注:此处仅为模拟功能,将实际生产环境拉至祭天。

[En]

Note: here is only the simulation function, the actual production environment will be pulled to sacrifice to heaven.

.
├── Dockerfile
├── Makefile
├── app.py
└── requirements.txt

我们可以通过 make image 命令在本地 build 一个镜像。我已经打包好一个镜像: 364950776/flask-demo:latest

kustomize

kustomize 目录用来编写应用的配置清单,同样的,这也是一个典型极简的 kustomize 支持的配置目录。

具体 kustomize 的用法此处不再赘述,值得一提的是,deployment 中的环境变量,是通过 configMapGenerator 注入的。这是 kustomize 的一个特性,环境变量都存储在 envs.yaml 中。

.
├── deployment.yaml
├── envs.yaml
├── kustomization.yaml
├── namespace.yaml
└── service.yaml

添加代码仓库

conda虚拟环境 | install 与 list 问题

conda虚拟环境 | install 与 list 问题

conda虚拟环境 | install 与 list 问题

注: 由于我们 github 中代码仓库是开放的,只需要添加地址即可,如果是私有仓库,需要额外添加认证信息。

部署自建应用

部署应用非常简单,在 UI 界面上填写配置即可。

发现问题

问题 1

业务源代码和部署列表在同一仓库,功能权限不够明确。源代码是开发团队关心的问题,部署是运营团队关心的问题。记录提交混乱,审计困难。

[En]

The business source code and deployment list are in the same warehouse, and the functional permissions are not clear enough. The source code is the concern of the development team, while the deployment is the concern of the operations team. The submission of records is confused and the audit is difficult.

所以 ArgoCD 官方强烈建议,业务源码和部署清单,分两个仓库存储。

问题 2

业务源码和部署清单,分两个仓库存储。每次源码发布新版本,开发人员都要手动打包镜像,再通知运维修改部署清单中的镜像,最后运维登录 ArgoCD 界面同步应用状态。

这一操作完全是低效的,没有完全自动化上述过程的自动方案。

[En]

This operation is completely inefficient, there is no automatic scheme to fully automate the above process.

结束语

虽然我们顺利地完成了对自建应用的 gitops 实验,但这并不是最佳实践,仍然有两个问题需要我们解决。下节课,咱们就来解决这两个问题。

参考资料

[1]

argocd in action: https://github.com/pyfs/argocd-in-action

Original: https://blog.csdn.net/u014249394/article/details/122183527
Author: LinuxSuRen
Title: Argo CD系列视频图文版之自建应用模拟开发场景

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/333228/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • conda python pcl

    遇到一个问题折腾很久,记录一下. 环境:ubuntu20.0 python3.8 原因是我想运行这个开放源码 [En] The reason is that I want to r…

    Python 2023年1月16日
    018
  • MongoDB数据库远程配置详解

    文章目录 一,MongoDB数据库远程配置详解 二,问题 三,服务器配置 四,放行端口 五,外网连接 六,mongodb操作注意 一,MongoDB数据库远程配置详解 MongoD…

    Python 2023年1月4日
    030
  • python界面设计

    当开始做一些python项目的时候不知从何入手,看着七七八八的界面设计也慌了,看完这几篇水文后希望对大家有所帮助。 UI (user interface)是程序用户的交互界面,终端…

    Python 2022年12月24日
    040
  • Python:学习成绩管理系统

    目录 前言 一、需求分析 1、概念设计 2、流程图设计 3、主界面设计 二、功能实现 1、主函数定义 2、录入学生信息 (1)功能实现 (2)输出界面 ​3、删除学生信息 (1)功…

    Python 2022年12月23日
    049
  • AI实现艺术品自动生成?太牛了

    CSDN话题挑战赛第1期活动详情地址:https://marketing.csdn.net/p/bb5081d88a77db8d6ef45bb7b6ef3d7f参赛话题:哪项人工智…

    Python 2023年1月20日
    030
  • pytest_allure_jenkins_email

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

    Python 2023年1月18日
    038
  • Python可视化与matplotlib绘制简单图表

    一、 数据可视化 1.什么是数据可视化 数据可视化是对数据可视化表示的科学技术研究。其中,这类数据的可视化表示被定义为以某种汇总形式提取的一种信息,包括相应信息单元的各种属性和变量…

    Python 2023年1月14日
    027
  • matplotlib.pyplot 库(二)

    matplotlib.pyplot 库(二) matplotlib.pyplot 相关函数 * plt库的读取和显示函数 plt库的基础图表函数 plt库的区域填充函数 plt库的…

    Python 2023年1月15日
    054
  • Flask框架知识集锦

    1. Flask中文文档 欢迎来到 Flask 的世界 — Flask 中文文档 (2.0.2) 2. 虚拟环境 虚拟环境可以为每一个项目安装独立的 Python 库,这样就可以隔…

    Python 2023年1月3日
    042
  • 装饰器的多种实现方式

    代码实现: 上面的嵌套函数看起来真的很难,所以下面介绍另外两种方法,它们相对较快且易于理解。 [En] The above nested function looks really…

    Python 2023年2月3日
    014
  • Python笔记(5)——if 语句一:条件测试(Python编程:从入门到实践)

    (1)使用and检查多个条件:and左右两个条件都为真时,整个表达式为True;至少有一个为假时,整个表达式为False。 (2)使用or检查多个条件:or左右两个条件至少有一个为…

    Python 2023年2月2日
    015
  • Linux之安装本地Python和pip

    tar zxfv Python-3.4.5.tgz ./configure –prefix=$HOME/install_dir make -j32 make insta…

    Python 2022年9月3日
    0123
  • 6、Python变量

    Python变量 变量的定义 变量是计算机内存的一个区域,可以存储指定范围内的值,并且值可以更改。 [En] A variable is an area of computer m…

    Python 2022年8月17日
    082
  • Anaconda、Conda、pip、Virtualenv的区别

    一、Anaconda 1.1 简介 Anaconda是一个包含180+的科学包及其依赖项的发行版本。其包含的科学包包括: conda, numpy, scipy, ipython …

    Python 2023年1月16日
    047
  • 我的第一个Scrapy爬虫,入门级原理详解,附详细源码

    平时写了很多小爬虫,最近找到一个小网页,页面特别简单,文章地址如下: (闲来无事,写个小爬虫,爬取1800篇高中作文)可以先了解一下爬取原理https://blog.csdn.ne…

    Python 2023年1月26日
    018
  • 4 Pandas 数据结构之生成DataFrame

    目录 用 列表 生成 DataFrame 用 多维数组字典 生成 DataFrame 用 Series字典 生成 DataFrame 用 列表字典 生成 DataFrame 用 元…

    Python 2022年12月29日
    043
最近整理资源【免费获取】:   👉 程序员最新必读书单  | 👏 互联网各方向面试题下载 | ✌️计算机核心资源汇总