beiklive's blog beiklive's blog
首页
  • 语言学习

    • C/C++
    • Python
    • Qt
  • 系统&引擎

    • Linux
    • Godot
  • 啥都学

    • 夏姬八学
    • 好好学习
  • 折腾记录

    • 树莓派
    • Obsidian
    • 实践记录
  • 技术文档
  • 工具网站
  • Github项目
  • 友情链接
  • 关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

beiklive

全沾艺人
首页
  • 语言学习

    • C/C++
    • Python
    • Qt
  • 系统&引擎

    • Linux
    • Godot
  • 啥都学

    • 夏姬八学
    • 好好学习
  • 折腾记录

    • 树莓派
    • Obsidian
    • 实践记录
  • 技术文档
  • 工具网站
  • Github项目
  • 友情链接
  • 关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 配置和换源
    • 中文编码支持
    • PIP换源
  • 代码片段
  • 打包py为可执行文件
  • Note_Python
beiklive
2024-05-07
目录

配置和换源

# 中文编码支持

# -*- coding: utf-8 -*-  
1

# PIP换源

换源 常用的国内镜像包括:

(1)阿里云 http://mirrors.aliyun.com/pypi/simple/

(2)豆瓣 http://pypi.douban.com/simple/

(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

(5)华中科技大学 http://pypi.hustunique.com/

临时换源

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
1

永久换源

(a)Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
1
2
3
4

(b) windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,然后新建文件pip.ini,即 %HOMEPATH%\pip\pip.ini,在pip.ini文件中输入以下内容:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
1
2
3
4
编辑 (opens new window)
#python
上次更新: 2024/05/22, 14:11:38
代码片段

代码片段→

最近更新
01
爬虫技术与法律风险:个人开发者的注意事项
05-22
02
个人开发者的抉择:个人工作室 vs 公司主体 🤔
05-22
03
《计算机网络,自顶向下方法》笔记(一)
05-20
更多文章>
Theme by Vdoing | Copyright © 2024-2024 beiklive | 苏ICP备20038092号-2
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式