Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python IOError:[Errno 0]在VSCode中写入Powershell的输出时出错_Python_Powershell_Visual Studio Code_Colorama - Fatal编程技术网

Python IOError:[Errno 0]在VSCode中写入Powershell的输出时出错

Python IOError:[Errno 0]在VSCode中写入Powershell的输出时出错,python,powershell,visual-studio-code,colorama,Python,Powershell,Visual Studio Code,Colorama,这是我在运行docker compose时在VSCode中遇到的错误 PS D:\Work\Imho\Api> docker-compose -f docker-compose.yml up Creating network "api_default" with the default driver Pulling ignite (apacheignite/ignite:latest)... latest: Pulling from apacheignite/ignite 5040bd29

这是我在运行docker compose时在VSCode中遇到的错误

PS D:\Work\Imho\Api> docker-compose -f docker-compose.yml up
Creating network "api_default" with the default driver
Pulling ignite (apacheignite/ignite:latest)...
latest: Pulling from apacheignite/ignite
5040bd298390: Pulling fs layer
fce5728aad85: Pulling fs layer

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 118, in perform_command
  File "compose\cli\main.py", line 926, in up
  File "compose\project.py", line 401, in up
  File "compose\service.py", line 305, in ensure_image_exists
  File "compose\service.py", line 1001, in pull
  File "compose\progress_stream.py", line 37, in stream_output
  File "codecs.py", line 370, in write
  File "site-packages\colorama\ansitowin32.py", line 40, in write
  File "site-packages\colorama\ansitowin32.py", line 141, in write
  File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
  File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose
这个错误只发生在我的三台机器中的一台上,所以我不知道是什么原因造成的。重置为出厂默认值或重新安装docker和vscode没有帮助。在没有docker compose的情况下,图像正在拖动,然后工作正常。所有机器都安装了windows 10和最新的stable docker


这是我在github上打开的。这种行为似乎只发生在VSCode powershell控制台中,而不发生在常规powershell控制台中。更改编码的解决方案表明没有帮助。

解决方案:在Windows 10上更新到1803。如果无法更新,请使用外部命令提示符

Python脚本也会发生同样的情况。显然,这是一个Windows Update问题:


编辑:由于我的公司限制更新,我的解决方法是在VS代码中使用外部终端

这就像,为什么你让事情变得更困难…我想让事情变得更简单,只运行vscode,而不是单独运行vscode和powershell=)vscode powershell shell是一个垃圾,不知道你为什么要用它,我想是因为在我在windows下遇到类似问题之前,没有人告诉我它是垃圾。在我的例子中,项目包含一些非UTF-8文件,这似乎是问题所在。使用gitbash使用相同的命令和代码解决了您在github中打开的bug中提到的问题
version: '3'
services:
  ignite:
    image: apacheignite/ignite