pipenv ---- python package manager

创建

  • pipenv –python 3.8

    • python version 存放在 Pipfile 文件 [requires] 部分
    • 注意:

      • 任意 python 版本的切换需要 pyenv 已经安装
  • pipenv –python path/to/python

    • 需要已经安装的本地 python 版本
  • 注意

    • 创建时,会自动导入 requirements.txt 内容

删除

  • pipenv –rm

激活

  • pipenv –shell
  • 退出

Poetry ---- Python Package Manager and Build Tool

安装

  • win10

    • 不要使用 pipx 安装
    • 使用官方 install-poetry.py

换源 mirror —- 镜像管理

换源

  1. 当前项目修改

使用命令 poetry source add

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 清华源
poetry source add --priority=default mirrors https://pypi.tuna.tsinghua.edu.cn/simple/

# 更改默认镜像 --default
poetry source add -d <name> <url>
poetry source add -d douban https://pypi.doubanio.com/simple/
poetry source add -d douban https://pypi.tuna.tsinghua.edu.cn/simple/


# 设置第二镜像 --secondary
poetry source add -s <name> <url>
  1. 全局换源

Pyenv ---- python shell env management

功能

  • python 版本管理工具
  • 通过 virtualenv 实现 虚拟环境管理
  • python 版本切换

    • 通过 pyenv local 实现项目关联 python 版本

      • 注:

        • 离开项目目录,自动切换成全局 python(pyenv global 设定)
    • 通过 pyenv global 实现全局 python 版本切换
    • 通过 pyenv shell 实现给定 shell(如 bash, zsh) 内部设置 python 版本

CheatSheet

临时启用 python 版本

  1. 启用: pyenv shell 2.7
  2. 退出: pyenv shell –unset

Liberime

windows 安装

手动复制相关文件到 emacs 安装目录 参考:https://github.com/merrickluo/liberime/releases 查看压缩包内部 Readme 解说

个人词库

激活问题

前提条件

  • liberime-build
  • liberime-deploy

上述命令正常

激活:

  • liberime-sync

注意:即使配置正常,在没有 sync 前,也检测不到个人词库

Hunspell ---- Spell Check Tool

字典文件格式

".dic" 和 ".aff"

1
2
wget -O en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/tree/en/en_US.aff
wget -O en_US.dic https://cgit.freedesktop.org/libreoffice/dictionaries/tree/en/en_US.dic

linux

1
2
3
sudo mkdir -p /usr/share/hunspell
sudo wget -O /usr/share/hunspell/en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/tree/en/en_US.aff
sudo wget -O /usr/share/hunspell/en_US.dic https://cgit.freedesktop.org/libreoffice/dictionaries/tree/en/en_US.dic