admin管理员组

文章数量:1794759

【python自学笔记】Win10环境问题记录

【python自学笔记】Win10环境问题记录

Win10环境问题记录
  • 换源问题
    • NPM换源
    • PIP换源
  • 个别问题

人无远虑必有近忧,决定自学python给自己加点技能,这里把学习过程做个记录。

换源问题 NPM换源

局域网手动换源很麻烦,推荐安装nrm对镜像源进行管理。

npm install -g nrm nrm ls //查看镜像源, *表示正在使用的 * npm -------- registry.npmjs/ yarn ------- registry.yarnpkg/ cnpm ------- rpmjs/ taobao ----- registry.npm.taobao/ nj --------- registry.nodejitsu/ npmMirror -- skimdb.npmjs/registry/ edunpm ----- registry.enpmjs/ nrm use taobao //切换 PIP换源

python避免不了引用三方库,默认官方仓库的速度很慢。

  • 方案一:运行命令配置
pip config set global.index-url mirrors.aliyun/pypi/simple/
  • 方案二:创建pip.conf文件
    • 在C:\\Users\\User 目录找到下列文件 /pip/pip.conf ,如果没有的话可以手动创建
    • 在上述文件中添加或修改:
[global] index-url = mirrors.aliyun/pypi/simple/ [install] trusted-host=mirrors.aliyun 个别问题

执行npm install 的时候报错:npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use 解决方案:使用管理员权限执行命令

npm install --global --production windows-build-tools

如果遇到windows-build-tools 安装时一直卡住的情况,优先考虑网络问题。推荐换个npm源试试。

本文标签: 环境问题笔记Python