python日记1 anaconda conda pycharm

Python(1)

关键词:
python anaconda conda pycharm关系
package management, virtual environment

Anaconda
是一个打包的集合,里面预装好了conda、某个版本的python、各种packages等

Conda
conda其核心功能是包管理和环境管理。

pycharm
是python IDE 集成开发环境(IDE:Integrated Development Environment)

各种不同的projectsConda
conda其核心功能是包管理和环境管理。

  1. package management
    python用于不同目的projects时会用到不同的package(如图:flask,matplotlib,pytorch)
    不同版本的python(eg.python3.5<>3.7)
    包管理与pip的使用方法类似

  2. virtual environment

the problem might be that You don’t have one single project in python you might have multiple projects for multiple purposes and you have all these packages installed globally on your machine.
the solution here is that we basically have an unlimited amount of computers on our single computer by using so-called virtual environments and these environments let us do exactly what you can see right here we can create separate environments for each purpose of python

python&anaconda&conda&package&virtual environmentConda VS pip
conda和pip区别Conda is a cross platform package and environment manager that installs and manages conda packages from the Anaconda repository as well as from the Anaconda Cloud. Conda packages are binaries. There is never a need to have compilers available to install them. Additionally conda packages are not limited to Python software. They may also contain C or C++ libraries, R packages or any other software.
This highlights a key difference between conda and pip. Pip installs Python packages whereas conda installs packages which may contain software written in any language. For example, before using pip, a Python interpreter must be installed via a system package manager or by downloading and running an installer. Conda on the other hand can install Python packages as well as the Python interpreter directly.
https://www.anaconda.com/blog/understanding-conda-and-pip

compiler 编译器 python interpreter 解释器

![python interpreter 解释器](https://img-blog.csdnimg.cn/353597a0453348ca8569817ef6b4fbee.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBARmxhbm5lcnl4aWFv,size_20,color_FFFFFF,t_70,g_se,x_16)

https://www.youtube.com/watch?v=23aQdrS58e0
在这里插入图片描述Terminal

打开terminal 输入conda list
this list simply shows us all the default packages that were installed when we installed anaconda
terminal conda list输入 conda env list
a list of our environments that we have at the moment we have the default environment this base environment right here
and we are currently working in this environment *
还有自己之前create 的environment(没有命名?, path为D:\INT104)
conda environment list创建新环境
me其实就是pycharm里面的新建python file
(名为ai37,python版本3.7)
在这里插入图片描述成功后conda env list
可以看到envionment list 中有ai37在这里插入图片描述通过 conda activate ai37 进入该环境
查看conda list(package list&versions), 发现python3.7 在其中
在这里插入图片描述

添加package
如果在default有这个package,则可以直接install。
成功后可以在conda list 中显示
如果没有,则用另外的方法 比如先建立channel再下载
conda config --add channels torch
记住是两个**-**
在这里插入图片描述在这里插入图片描述总结
在这里插入图片描述
python环境搭建完整过程
https://www.runoob.com/python/python-install.html

环境变量配置

程序和可执行文件可以在许多目录,而这些路径很可能不在操作系统提供可执行文件的搜索路径中。
path(路径)存储在环境变量中,这是由操作系统维护的一个命名的字符串。这些变量包含可用的命令行解释器和其他程序的信息。
Unix或Windows中路径变量为PATH(UNIX区分大小写,Windows不区分大小写)

运行python
cmd、pycharm(IDE)
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值