嗨,我在运行 python IDLE 时遇到问题。
一旦我安装了 EMACS 并卸载了它,每当我尝试运行 python IDLE 时,它都会给我:
警告:os.path.expanduser("~") 指向 C:\Program Files\Emacs\, 但路径不存在
IDLE 确实可以工作,但我无法通过简单地单击“使用 IDLE 打开”来启动 IDLE。 我想我需要更改 os.path.expanduser 的路径来修复此错误? 但我找不到它。 我应该在哪里寻找以及它最初指向哪条路径?
谢谢。
最佳答案
根据文档,
On Windows, HOME and USERPROFILE will be used if set, otherwise a combination of HOMEPATH and HOMEDRIVE will be used. An initial ~user is handled by stripping the last directory component from the created user path derived above.
您可以尝试在命令提示符下运行“set”来查看这两个环境变量是否已设置。如果是,请删除该设置。
关于python - 如何更改 python 中 os.path.expanduser ("~") 的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10764025/