“pip freeze >requirements.txt”出错

问题描述 投票:0回答:2

我正在阅读《Python 速成课程》一书,并且正在阅读有关将我的应用程序部署到 Heroku 的部分。当尝试创建 requests.txt 文件时,我收到此错误:

Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'>
OSError: [Errno 9] Bad file descriptor

我在 Windows 上并使用 venv 模块。从命令提示符运行命令。

python pip
2个回答
2
投票

不需要双引号。并用>>代替>。


0
投票

在生成requirements.txt文件时,我遇到了同样的错误。我发现我的防病毒软件正在停止 pip 进程。从我的防病毒软件中排除 pip 进程解决了我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.