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中重新设置




相关推荐
学IT的周星星14 小时前
LangGraph:用「流程图」的方式编排 Agent
数据库·人工智能·大模型·llm·流程图·agent
NC 王炸14 小时前
不用 API Key,也能让网页调用 AI?Opera 把本地模型接进了浏览器
人工智能·浏览器扩展·ai 工具·本地 ai·opera·webai
锋行天下14 小时前
Langgraph 实现类似Langchain记忆上下文过长裁剪
人工智能·后端
不老刘14 小时前
Antigravity 的 New Worktree 模式:给 AI 代理一个安全的“平行工位”
人工智能·git·ai编程·antigravity
m0_7196408714 小时前
高校人工智能实验室搭建,2026年具身智能科研设备适配建议
人工智能·经验分享
樱木花道長14 小时前
AMD Ross 深度系列 8:FAQ 七问七答(文末附网盘链接)
人工智能·fpga开发
吴名氏.14 小时前
Java转AI Agent教程(第一周)让模型先跑起来
人工智能·python·ai·ai agent
zhangfeng113314 小时前
中关村国际前沿科技大赛(创新药赛道)详细介绍 ai药物比赛
人工智能·科技
xiaoyunxuexibiji14 小时前
供应商质量协同如何实现闭环管理?从到货检验到整改与质量索赔
人工智能
xn713314 小时前
本地 AI 知识库跨设备同步:SQLite FTS5、Embedding、Tombstone 和引用校验
人工智能·sqlite·ai编程