AI入坑之路——(1)搭建本地的Python与Jupyter开发环境

搭建本地的Python与Jupyter开发环境

安装PyCharm、MiniConda

PyCharm下载链接
miniconda下载链接

Conda与Pip替换国内源

下面要修改的文件主要有:

shell 复制代码
|---C:\Users\用户名\
	|---.condarc
	|---pip
		|---pip.ini

windows系统下打开C:\Users\用户名\,用户名为自定义或管理员Administrator。

打开.condarc文件(如果没有就新建),设置为阿里云源

txt 复制代码
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

打开C:\Users\用户名\pip\pip.ini文件,如果没有就新建

shell 复制代码
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
timeout = 120

使用conda创建python环境变量

查看当前的环境,默认只有base环境

shell 复制代码
conda env list

创建一个python3.10的环境,并激活

shell 复制代码
conda create --name py310 python=3.10
conda activate py310

在Python环境安装Jupyter

上述conda环境创建好后就有一个python 3.10的环境了,执行pip安装Jupyter的包

shell 复制代码
pip install jupyterlab==4.0.9
pip install ipywidgets==8.1.1

Jupyter 是一款跨语言、交互式的计算环境与文档工具,核心形态是 Jupyter Notebook(笔记本)和 Jupyter Lab(更强大的集成环境),本质是 "让代码、数据、文档、可视化结果融为一体",解决传统代码开发 "孤立、难复现、难展示" 的问题,是数据科学、科研、教学、快速开发的核心工具。

安装完成后使用jupyter-lab命令启动本地jupyter lab环境

shell 复制代码
jupyter-lab .

在PyCharm中使用conda环境

新建工程时配置解释器环境

存量工程可以在setting中重新设置




相关推荐
m0_613856293 分钟前
mysql如何优化重复索引_mysql冗余索引查找与处理
jvm·数据库·python
四维迁跃4 分钟前
Python Web开发如何防范SQL注入_使用参数化查询与ORM实践
jvm·数据库·python
噜噜噜阿鲁~5 分钟前
python学习笔记 | 8.3、函数式编程-匿名函数
笔记·python·学习
minstbe6 分钟前
【AI本体论研究学习】本体的核心元素:类、属性、实例与关系——拆解 OWL/RDF 四大基石
人工智能·学习
YJlio9 分钟前
Windows Internals 读书笔记 10.3.3:Task Scheduler 架构详解
人工智能·windows·笔记·python·学习·chatgpt·架构
新加坡内哥谈技术10 分钟前
长时间运行的智能体
人工智能
AI木马人10 分钟前
4.人工智能实战:大模型服务如何避免被突发流量打崩?从“接口直连GPU”到“队列调度架构”的完整工程重构
人工智能·重构·架构
2401_8330336211 分钟前
如何自动更新SQL标签状态_利用触发器实现基于逻辑的状态机
jvm·数据库·python
阿满aman13 分钟前
Claude+DeepSeekv4pro网络信息搜索报告
人工智能·功能测试·搜索引擎·交互