新闻详情

新闻详情

首页 / 资讯中心 / 详情

python-anaconda cuda安装和jupyter notebook使用

发布时间:2026/10/1 16:44:39来源:尧图网络
python-anaconda cuda安装和jupyter notebook使用
概要windowspython快速下载PYTORCH下载地址ANACONDA1. 下载地址2. 安装后设置环境变量3. 配置源4. 内网配置代理5. 常用命令CUDA安装JUPYTER NOTEBOOKjupyter notebook安装jupyter notebook安装目录插件pip下载慢问题如何查看pip当前的路径如何查看pip当前的配置文件配置安装镜像的地址linux环境安装windowspython快速下载https://mirrors.tuna.tsinghua.edu.cn/python/3.12.10/PYTORCH下载地址https://pytorch.org/get-started/locally/ANACONDA1. 下载地址https://www.anaconda.com/products/distribution这里需要右键保存即可下载一直点击下一步安装完成。2. 安装后设置环境变量C:\ProgramData\Anaconda3C:\ProgramData\Anaconda3\ScriptsC:\ProgramData\Anaconda3\Library\binC:\ProgramData\Anaconda3\Library\mingw-w64\binC:\ProgramData\Anaconda3\Library\usr\bin如果是miniconda3环境变量是C:\ProgramData\miniconda3C:\ProgramData\miniconda3\ScriptsC:\ProgramData\miniconda3\Library\binC:\ProgramData\miniconda3\Library\mingw-w64\binC:\ProgramData\miniconda3\Library\usr\bin3. 配置源conda config --set show_channel_urls yes‪C:\Users\Administrator.condarc修改内容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或者channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ show_channel_urls: true ssl_verify: false或者直接使用命令# 清除所有频道 conda config--remove-key channels # 添加清华源 conda config--add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config--add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/conda config--add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/# 设置显示频道URL conda config--set show_channel_urls yes # 可选添加conda-forge conda config--add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/4. 内网配置代理‪C:\Users\Administrator.condarc中增加如下内容proxy_servers:http:http://xxxx:Li!proxynj.45.com:8080https:http://xxxx:Li!proxynj.34566.com:8080ssl_verify:false5. 常用命令环境管理 conda create--name myenv创建一个名为myenv的新环境。 conda init执行activate前需要执行 conda activate myenv激活名为myenv的虚拟环境。 conda deactivate关闭当前激活的虚拟环境。 conda envlist列出所有已创建的环境。 conda env export--name myenv--fileenvironment.yaml导出名为myenv的环境配置到environment.yaml文件。 conda env create--fileenvironment.yaml根据environment.yaml文件创建一个新环境。 conda remove--name EV--all删除名为EV的环境及其所有包。 包管理 condalist查看当前环境中已安装的包。 conda search xxxx搜索名为xxxx的包。 conda install xxxx在当前环境中安装名为xxxx的包。 conda install-n EV xxxx在名为EV的环境中安装名为xxxx的包。 conda update xxxx更新名为xxxx的包到最新版本。如升级python版本 conda remove xxxx从当前环境中删除名为xxxx的包。 配置管理 conda config--add channels 通道名称向配置中添加一个新的通道。 conda config--remove channels 通道名称从配置中移除指定的通道。 conda config--get channels列出当前配置中所有配置的通道。 conda config--remove-key 配置项重置指定配置项的值为默认值。 conda config--edit打开配置文件以进行手动编辑。 更新和升级 conda update conda更新conda到最新版本。 conda update anaconda更新Anaconda及其相关组件到最新版本。 conda update python更新Python到最新版本。CUDA安装https://blog.csdn.net/weixin_44189155/article/details/126359352JUPYTER NOTEBOOKjupyter notebook安装打开anaconda的命令提示行或者执行执行pip install jupyter输入命令并设定密码使用u生产的密码即可#如果没有ipython请使用pip install ipython $ ipython from notebook.authimportpasswdpasswd()#不使用ipython python from notebook.authimportpasswdpasswd()#注意 有的生成的是sha1有的生成的是argon2(单引号全部在内都复制下来)都是可以的记得前面加u记住生成的密码退出ipython,生成配置文件jupyter notebook --generate-configwindows文件默认会在目录c:/users/mypc/jupyter\jupyter_notebook_config.pylinux文件默认会在目录~/.jupyter/jupyter_notebook_config.py或者/userxxxx/.jupyter/jupyter_notebook_config.py打开config文件编辑如下内容类似如下保存c.NotebookApp.ip*c.NotebookApp.passworduargon2:$argon2id$v19$m10240,t10,p8$TkrMEqNT7Hjcms5Lgt46Bg$8wQgGoxGNluYv1J7f49FtRSgZjwLu53cr9mF2xr8Ec.NotebookApp.allow_remote_accessTrue# 更改目录注意版本c.NotebookApp.notebook_dirD:\\jpdirnotebook6x版本c.NotebookApp.notebook_dir‪F:\jupyterdirnotebook7x版本anaconda命令行启动jupyter notebook启动启动端口以及token会有提示在jupyter notebook中启动的conda的base环境中如果要使用torch要么在base环境中安装要么要进行配置参考哔哩哔哩https://www.bilibili.com/video/BV1hE411t7RN?p2vd_sourcedf50a7aa820e2fe3209e1b5cb4fa3d53注意jupyter_notebook_config.py与jupyter_notebook_config.json其中json文件的优先级高于py文件因此发现有修改了密码不生效的场景可以检查下另外如果出现报错No module named ‘notebook.auth’请卸载掉notebook安装6.5.4的notebookjupyter notebook安装目录插件安装pip install jupyter_contrib_nbextensions--trusted-host mirrors.tools.huawei.com-i http://mirrors.tools.huawei.com/pypi/simplejupyter contrib nbextension install--user重启jupyter notebook重启后tab里面就多了一项选择Table of Contents然后打开文件就可以看到目录了pip下载慢问题pip语句结束后边加上 -i https://pypi.tuna.tsinghua.edu.cn/simple注意-i前面有个空格常用的源有阿里云http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学http://pypi.hustunique.com/山东理工大学http://pypi.sdutlinux.org/豆瓣http://pypi.douban.com/simple/ 这个感觉不错清华https://pypi.tuna.tsinghua.edu.cn/simple百度https://mirror.baidu.com/pypi/simple如何查看pip当前的路径C:\Users\l8ccccwhere pipD:\pythonext\Python\Python313\Scripts\pip.exe如何查看pip当前的配置文件C:\Users\xxxpip config-v listForvariantglobal,willtryloading C:\ProgramData\pip\pip.iniForvariantuser,willtryloading C:\Users\xxx\pip\pip.iniForvariantuser,willtryloading C:\Users\xxx\AppData\Roaming\pip\pip.iniForvariantsite,willtryloading D:\pythonext\Python\Python313\pip.ini global.extra-index-url\nhttps://pypi.doubanio.com/simple/\nhttps://pypi.org/simple/\nhttps://mirrors.aliyun.com/pypi/simple/\nhttps://pypi.doubanio.com/simple/\nhttps://pypi.tuna.tsinghua.edu.cn/simple\nhttps://pypi.mirrors.ustc.edu.cn/simple/ global.index-urlhttps://mirrors.tools.huawei.com/pypi/simple global.timeout120global.trusted-host\nmirrors.aliyun.com\npypi.doubanio.com\npypi.org\nmirrors.tools.huawei.com\npypi.tuna.tsinghua.edu.cn\npypi.mirrors.ustc.edu.cn或者PSC:\Users\xx pip config debug env_var: env: global: C:\ProgramData\pip\pip.ini,exists: False site: d:\python38\pip.ini,exists: False user: C:\Users\xx\pip\pip.ini,exists: False C:\Users\xx\AppData\Roaming\pip\pip.ini,exists: True global.index-url: https://mirrors.tools.huawei.com/pypi/simple global.timeout: 120 global.extra-index-url: https://pypi.doubanio.com/simple/ https://pypi.org/simple/ https://mirrors.aliyun.com/pypi/simple/ https://pypi.doubanio.com/simple/ https://pypi.tuna.tsinghua.edu.cn/simple https://pypi.mirrors.ustc.edu.cn/simple/说明生效的配置文件在C:\Users\xx\AppData\Roaming\pip\pip.ini配置安装镜像的地址临时如果报错ProxyError(‘Cannot connect to proxy.’, timeout可以尝试下面1的方法pip install --trusted-host mirrors.tools.aliyun.com -i https://mirrors.tools.aliyun.com/pypi/simple xxx永久Pip的配置文件如果没有该文件可以手动创建为用户根目录下的~/.pip/pip.confWindows路径为C:\Users\UserName\pip\pip.ini, 您可以配置如下内容 [global] index-url https://mirrors.tools.huawei.com/pypi/simple timeout 120 extra-index-url https://pypi.doubanio.com/simple/ https://pypi.org/simple/ https://mirrors.aliyun.com/pypi/simple/ https://pypi.doubanio.com/simple/ https://pypi.tuna.tsinghua.edu.cn/simple https://pypi.mirrors.ustc.edu.cn/simple/ trusted-host mirrors.aliyun.com pypi.doubanio.com pypi.org mirrors.tools.huawei.com pypi.tuna.tsinghua.edu.cn pypi.mirrors.ustc.edu.cn proxy http://xxxx:xxxxxproxy.aliyun.com:8080或者在执行如下命令C:\Users\222pip config set global.https-proxy http://333:33333!aaproxy.333.com:8080会自动生成如下路径将上面的内容复制到下面文件就可以了Writing to C:\Users\222\AppData\Roaming\pip\pip.ini在安装的时候可以能会出现如下提示但是不要急着退出让它继续跑,后面会正常下载。ror(SSLCertVerificationError(1,[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1125))): /pypi/simple/tornado/ WARNING: Retrying (Retry(total0, connectNone, readNone, redirectNone, statusNone)) after connection broken by SSLError(SSLCertVerificationError(1,[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1125))): /pypi/simple/tornado/ Could not fetch URL https://pypi.mirrors.ustc.edu.cn/simple/tornado/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(hostmirrors.ustc.edu.cn, port443): Max retries exceeded with url: /pypi/simple/tornado/ (Caused by SSLError(SSLCertVerificationError(1, [SSL: CERTIFICATE_VERIFY_FAILED]certificate verify failed: self signed certificateincertificate chain(_ssl.c:1125)))) - skipping Collecting tornado6.2.0 (from notebook) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/61/cc/58b1adeb1bb46228442081e746fcdbc4540905c87e8add7c277540934edb/tornado-6.4.2-cp38-abi3-win_amd64.whl (438 kB) WARNING: Retrying (Retry(total4, connectNone, readNone, redirectNone, statusNone)) after connection broken by ProxyError(Cannot connect to proxy., OSError(Tunnel connection failed: 504 Gateway Time-out)): /pypi/simple/anyio/pip设置代理pip config set global.https-proxy http://xx:xxproxy.ali.com:8080pip config set global.http-proxy http://xx:xxproxy.ali.com:8080pip config list 查看是否上设置成功需要注意的事情如果是powershell执行pip安装如果有特殊字符不需要转义。CMD需要转义。linux环境安装下载地址https://repo.anaconda.com/archive/设置包可执行chmod x安装./anaxxxx.sh安装完成后询问你是否需要将环境变量加入到.bashrc输入yes然后source bashrc执行conda即可使用jupyter notebook参照windows补充jupyter notebook 后台运行 nohup jupyter notebook --allow-root jupyter.log 21
网站建设高端定制企业官网
RELATED

相关资讯

更多精彩内容,欢迎继续阅读

较早相关资讯

最新相关资讯

Python面部表情识别系统实战:从环境配置到摄像头实时部署全指南 2026/10/1 17:22:26

Python面部表情识别系统实战:从环境配置到摄像头实时部署全指南

简介:面向Python图像识别与深度学习的课程设计需求,此项目提供了一套完整可运行的面部表情识别分析方案。系统选取高兴与沮丧两种情绪,构建二分类识别流程,完整覆盖图像处理与图像分析两个阶段;借助Keras、TensorFlow、…

阅读更多 →
Qt源码编译OpenGL功能测试失败:configure检测机制与平台解决指南 2026/10/1 17:22:26

Qt源码编译OpenGL功能测试失败:configure检测机制与平台解决指南

简介:Qt 5.9.9在Ubuntu 14.04 LTS下执行./configure -prefix $PWD/qtbase -opensource时,常报The OpenGL functionality tests failed错误,导致配置中断。遇到该报错的开发者,可参考这套包含3个文件的排错记录与验证文件&#xff…

阅读更多 →
VMware Tools安装全指南:macOS虚拟机驱动优化与故障排查 2026/10/1 17:22:25

VMware Tools安装全指南:macOS虚拟机驱动优化与故障排查

帮你折腾过十几次macOS虚拟机的人来聊聊VMware Tools这件事。很多人在VMware里把macOS系统装好,开机一看:分辨率固定在1024x768、鼠标拖不动、剪贴板复制不了东西,还以为是系统安装有问题,其实真正的原因是缺了VMware Tools这层驱…

阅读更多 →
基于Python+OpenCV的人脸识别考勤系统实现详解 2026/10/1 17:22:25

基于Python+OpenCV的人脸识别考勤系统实现详解

简介:这是基于Python与OpenCV构建的人脸识别员工考勤系统毕业设计项目,已经过导师指导并获高分通过,适用于高校毕业设计、课程设计与期末大作业,也可作为计算机视觉初学者的人脸识别实践范本。资源包大小为197.57MB,共…

阅读更多 →
TSN网络调度与仿真:TSNkit生成门控表,OMNeT++验证闭环 2026/10/1 17:22:24

TSN网络调度与仿真:TSNkit生成门控表,OMNeT++验证闭环

简介:面向TSN网络研究与开发人员的实践资源,围绕TSNkit与OMNeT仿真框架,解决TSN网络建模、流量调度与性能验证问题。压缩包大小83.24MB,内含OMNeT工程源码、TSNkit扩展模块及YANG配置示例,目录结构清晰,便于…

阅读更多 →
基于YOLOv8的实验室防护服穿戴检测完整项目实践 2026/10/1 17:22:18

基于YOLOv8的实验室防护服穿戴检测完整项目实践

简介:基于YOLOv8的实验室防护服穿戴规范检测项目,针对实验室安全规范检查需求,面向计算机视觉、人工智能方向的毕业设计或课程设计,提供含完整数据集、源码、可视化界面及部署教程的一站式资源包。项目代码经测试可直接运行&#…

阅读更多 →

今日资讯

本周资讯

本月资讯

看完文章仍有疑问?

联系尧图顾问,获取一对一建站咨询

立即免费咨询 📞 400-888-8888
📞 ✉