1
$\begingroup$

I am using Blender 2.9 (and its corresponding python 3.9) on MacOS (BigSur 11.4). I want to use pip to install scipy so that I can use it within Blender either in the console or running a script. When I try to use or upgrade Blender's pip, I get a broken pipe error.

I run:

bin/python3.9 lib/python3.9/ensurepip

and my output is:

ERROR: Pipe to stdout was broken
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

Frustratingly, when I try to run:

bin/python3.9 -m pip install --upgrade pip

I get the same thing plus this message telling me to upgrade using the command that just failed.

ERROR: Pipe to stdout was broken
WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/Applications/Blender.app/Contents/Resources/2.93/python/bin/python3.9 -m pip install --upgrade pip' command.
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

The only thing I found was this github issue where a user of pip encountered the same error when using pip list | head which they seemed to have fixed, and makes sense because they explicitly used the pipe. When I am using pip in this case, I don't know what exactly is calling pipe so I don't know where the error is really coming from.

$\endgroup$
4
  • $\begingroup$ linuxpip.org/broken-pipe-python-error may be helpful $\endgroup$ Commented Dec 20, 2021 at 4:09
  • $\begingroup$ thank you I'll check this out $\endgroup$
    – sarah
    Commented Dec 20, 2021 at 8:47
  • $\begingroup$ Hello, can you make sure you are using Blender version 2.93 or up ? Versions 2.90, 2.91 and 2.92 are NOT compatible with python 3.9, but they are with python 3.7 $\endgroup$
    – Gorgious
    Commented Dec 20, 2021 at 12:05
  • $\begingroup$ yes, I am using 2.93.2 $\endgroup$
    – sarah
    Commented Dec 20, 2021 at 16:45

1 Answer 1

1
$\begingroup$

It was an encoding problem in my terminal (bash in mac's Terminal app). For some reason invoking blender's version of python wasn't fully functional. It wouldn't even return ensurepip's version or do basic math operations:

/Applications/Blender.app/Contents/Resources/2.93/python/bin/python3.9
Python 3.9.2 (default, Mar 16 2021, 14:53:03) 
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ensurepip
>>> ensurepip.version()
>>> print(ensurepip.version())
>>> 
>>> v=ensurepip.version()
>>> v
>>> print(v)
>>> type(v)
>>> 
>>> 3+6
>>> 
>>> exit()
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

I have no idea why, but doing the same commands in iTerm2 worked fine and I was able to successfully install scipy.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .