Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wojiushixiaobai/python-embed-win64
python embed pip tk
https://github.com/wojiushixiaobai/python-embed-win64
embedding pip python tkinter
Last synced: 16 days ago
JSON representation
python embed pip tk
- Host: GitHub
- URL: https://github.com/wojiushixiaobai/python-embed-win64
- Owner: wojiushixiaobai
- Created: 2024-09-27T05:34:02.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-12-08T06:20:10.000Z (21 days ago)
- Last Synced: 2024-12-08T06:25:12.069Z (21 days ago)
- Topics: embedding, pip, python, tkinter
- Homepage: https://github.com/python/cpython
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python-Embed-Win64
- 添加了 **pip** 和 **tkinter** 的 Embedding Python
## 配置环境
修改 **python\*._pth** 文件
```shell
cat .\python*._pthpython311.zip
packages
.# Uncomment to run site.main() automatically
import site
```也可以通过指定 **PYTHONPATH** 环境变量来移除 **python\*._pth** 文件
```shell
# cd 到 python.exe 所在目录, 或者使用绝对路径
# 如果需要写入到系统环境变量, 一定要使用绝对路径
$Env:PYTHONPATH = ".\packages;.\Lib\site-packages"
```*大多数的时候单项目修改 **python\*._pth** 文件即可。*
*不使用 **python\*._pth** 是为了解决工作目录的问题,也就是你在外部调用 **python** 时会出现找不到模块的问题。*## 运行 Python
**pip** 模块
```shell
.\python.exe -m pip listPackage Version
---------- -------
pip 24.0
setuptools 65.5.0[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip
```**tkinter** 模块
```shell
.\python.exe
Python 3.11.10 (tags/v3.11.10:0c47759, Sep 27 2024, 21:18:53) [MSC v.1941 64 bit (AMD64)] on win32
>>> import tkinter as tk
>>> tk.TkVersion
8.6
```