37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
import sys
|
|
import os
|
|
import subprocess
|
|
|
|
print("=== Python 诊断信息 ===")
|
|
print(f"Python 路径: {sys.executable}")
|
|
print(f"Python 版本: {sys.version}")
|
|
print(f"当前目录: {os.getcwd()}")
|
|
print(f"Python 路径列表: {sys.path}")
|
|
|
|
print("\n=== 检查模块导入 ===")
|
|
try:
|
|
from autocommit import cli
|
|
print("✅ 可以导入 autocommit.cli")
|
|
except ImportError as e:
|
|
print(f"❌ 导入失败: {e}")
|
|
print(f"当前目录内容: {os.listdir('.')}")
|
|
|
|
print("\n=== 检查 .venv/Scripts/autocommit.exe ===")
|
|
exe_path = ".venv/Scripts/autocommit.exe"
|
|
if os.path.exists(exe_path):
|
|
print(f"✅ 可执行文件存在: {exe_path}")
|
|
|
|
# 查看 exe 的内容
|
|
try:
|
|
with open(exe_path, 'rb') as f:
|
|
content = f.read(2000) # 读取前2000字节
|
|
if b'autocommit.cli' in content:
|
|
print("✅ EXE 文件包含正确的模块引用")
|
|
else:
|
|
print("❌ EXE 文件可能没有正确的模块引用")
|
|
print(f"EXE 文件大小: {os.path.getsize(exe_path)} 字节")
|
|
except Exception as e:
|
|
print(f"❌ 无法读取 EXE 文件: {e}")
|
|
else:
|
|
print(f"❌ 可执行文件不存在: {exe_path}")
|