matlab调用python(anaconda安装python)

本文详细介绍了如何在Windows系统上安装Anaconda,包括添加环境变量、创建虚拟环境、查看环境信息、配置清华源以及确保MATLAB与Python版本的兼容。
摘要由CSDN通过智能技术生成

安装anaconda后,
环境变量添加

D:\Anaconda 
D:\Anaconda\Scripts 
D:\Anaconda\Library\mingw-w64\bin
D:\Anaconda\Library\usr\bin 
D:\Anaconda\Library\bin

常用命令

conda info 查看当前环境的信息
conda info -e 查看已经创建的所有虚拟环境
conda activate xx 切换到xx虚拟环境
conda create -n xxx python=3.9 创建一个python3.9 名为xxx的虚拟环境。然后输入python 检查下是否为32位的python2.7版本,这样即创好了。

添加清华源

修改C盘用户.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
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

添加后
(base) C:\Users\aikera>conda config --show channels
channels:

  • ‘https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/’
  • ‘https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/’
  • defaults
  • conda-forge

(有问题可以看这篇https://blog.csdn.net/chenhepg/article/details/113974497)

matlab指定python路径

pyenv('Version', 'D:\Anaconda3\python.exe');
pyversion

conda env list
pyenv('Version', 'C:\Users\admin\.conda\envs\python310\python.exe');

支持matlab支持python版本
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值