新机迁移-hexo\vscode\便携git\miniconda\i卡环境配置
新机迁移-hexo\vscode\便携git\miniconda\i卡环境配置
FrWalkerhexo配置过程
1.安装nvm
官网下载安装包即可,我的版本是1.1.11
2.安装node
我的版本是v22.13.0,使用命令nvm install v22.13.0
3.解决npm报错
输入nvm use npm install -g hexo-cli
切换到node-v22.13.0版本,再输入npm -v
会出现:
1 | npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 |
因为在此系统上禁止运行脚本,也就是说没有权限,输入命令get-ExecutionPolicy
得到:
1 | Restricted |
受限制的,表示状态是禁止的,添加权限,输入命令Set-ExecutionPolicy -Scope CurrentUser
,再输入参数RemoteSigned
得到:
1 | 位于命令管道位置 1 的 cmdlet Set-ExecutionPolicy |
验证,输入get-ExecutionPolicy
和npm -v
得到RemoteSigned和10.9.2:
4.安装hexo
输入npm install -g hexo-cli
5.验证
输入hexo s
,博客正常生成和显示
附git便携版配置过程
1.将PortableGit/cmd
放入环境变量Path
2.配置全局变量
1 | git config –global user.name “FrwalkerCn” |
2.运行git bash输入ssh-keygen -t rsa -C frwalker.cn@gmail.com
生成公钥和私钥
3.将公钥配置在github账号的SSH and GPG keys里
4.在/c/Users/luowei/.ssh/config加入:
1 | Host github.com |
5.测试git是否正常使用,输入 ssh -T git@github.com
得到:Hi FrWalkerCn! You’ve successfully authenticated, but GitHub does not provide shell access.
将git配置进vscode
在vscode的setting.json添加Git Bash路径:
1 | "terminal.integrated.profiles.windows": { |
注意,只有bin/bash.exe是控制台应用程序,可以重定向stdin/stdout/stderr,可用作集成shell;git-bash.exe则是windows应用程序会弹窗而无法集成,以WinMain作为条目。
miniconda
下载地址:https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
注意安装时不要勾选add path,安装完成后手动将C:\Users\luowei\miniconda3\Scripts加入环境变量,在任意shell里conda init后即可正常使用。
使用方式同conda,见windows10 深度学习环境配置torch、cuda,这里仅记录i卡和n卡的配置区别,因为新电脑是i卡。
i卡配置
1.安装驱动
官网搜索后安装即可,我的是英特尔显卡a770,对应驱动网址:https://www.intel.com/content/www/us/en/download/785597/intel-arc-iris-xe-graphics-windows.html
安装前最好使用DDU软件在安全模式下卸载干净之前的驱动
2.配置torch环境
1 | conda create -n A770Pytorch python pip |
(如果想要删除,使用conda remove A770Pytorch --all
)
3.验证
conda activate A770Pytorch
激活环境在python控制台验证可以得到:
1 | (A770Pytorch) PS C:\Users\luowei> python |
使用https://gitee.com/Pauntech/Pytorch-2.5的示例进行训练:
1 | (A770Pytorch) PS C:\Users\luowei\Desktop\Pytorch-2.5-master> python .\train_on_arc.py |
验证成功