0

I have a script that include the following lines:

  &l:makeprg = $'manim {expand("%:t")} {scene} {flags} --fps 30 --disable_caching -v WARNING --save_sections'
  make

The command runs correctly, in-fact the following is what I expect:

:!manim Fourier2.py FourierIntro -ql --fps 30 --disable_caching -v WARNING --save_sections  >C:\Users\yt75534\AppData\Local\Temp\VLX2AAD.tmp 2>&1

And the output file (which is a .mp4 file) is correctly created.

However, here is the :messages that I got once the make process has ended:

Meddelandeansvarig: Johan Svedberg <[email protected]>
C:\Users\yt75534\Documents\github_ctip\08_FourierTransform
"Fourier2.py" 672L, 26748B
Fel upptäcktes vid bearbetning av function <SNR>78_Manim[17]..BufEnter Autokommandon för "*"..function <SNR>1_Get_gitbranch:
rad    1:
E282: Kan inte läsa från "C:\Users\yt75534\AppData\Local\Temp\VNJD48.tmp"
E282: Kan inte läsa från "C:\Users\yt75534\AppData\Local\Temp\VNJD87.tmp"
(3 av 4): FadeIn(VGroup of 5 submobjects):  75%|#######5  | 9/12 [00:00<00:00, 81.08it/s]^M                                                                                            ^M^MAnimation 1: _MethodAnimation(VGroup of 5 submobjects):   0%|          | 0/30 [00:00<?, ?it/s]^MAnimation 1: _MethodAnimation(VGroup of 5 submobjects):  30%|###       | 9/30 [00:00<00:00, 79.65it/s]^MAnimation 1: _MethodAnimation(VGroup of 5 submobjects):  60%|######    | 18/30 [00:00<00:00, 80.48it/s]^MAnimation 1: _MethodAnimation(VGroup of 5 submobjects):  90%|######### | 27/30 [00:00<00:00, 81.08it/s]^M                                                                                                       ^M^MAnimation 2: Transform(VMobject):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 2: Transform(VMobject): 100%|##########| 12/12 [00:00<00:00, 119.98it/s]^M                                                                                  ^M^MAnimation 4: FadeIn(VGroup of 5 submobjects):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 4: FadeIn(VGroup of 5 submobjects):  75%|#######5  | 9/12 [00:00<00:00, 81.80it/s]^M                                                                                            ^M^MAnimation 5: _MethodAnimation(VGroup of 5 submobjects):   0%|          | 0/30 [00:00<?, ?it/s]^MAnimation 5: _MethodAnimation(VGroup of 5 submobjects):  30%|###       | 9/30 [00:00<00:00, 84.11it/s]^MAnimation 5: _MethodAnimation(VGroup of 5 submobjects):  60%|######    | 18/30 [00:00<00:00, 83.65it/s]^MAnimation 5: _MethodAnimation(VGroup of 5 submobjects):  90%|######### | 27/30 [00:00<00:00, 83.48it/s]^M                                                                                                       ^M^MAnimation 6: Transform(VMobject):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 6: Transform(VMobject): 100%|##########| 12/12 [00:00<00:00, 113.21it/s]^M                                                                                  ^M^MAnimation 8: FadeIn(VGroup of 5 submobjects):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 8: FadeIn(VGroup of 5 submobjects):  75%|#######5  | 9/12 [00:00<00:00, 84.90it/s]^M                                                                                            ^M^MAnimation 9: _MethodAnimation(VGroup of 5 submobjects):   0%|          | 0/30 [00:00<?, ?it/s]^MAnimation 9: _MethodAnimation(VGroup of 5 submobjects):  27%|##6       | 8/30 [00:00<00:00, 77.67it/s]^MAnimation 9: _MethodAnimation(VGroup of 5 submobjects):  57%|#####6    | 17/30 [00:00<00:00, 81.06it/s]^MAnimation 9: _MethodAnimation(VGroup of 5 submobjects):  87%|########6 | 26/30 [00:00<00:00, 81.41it/s]^M                                                                                                       ^M^MAnimation 10: Transform(VMobject):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 10: Transform(VMobject): 100%|##########| 12/12 [00:00<00:00, 114.27it/s]^M                                                                                   ^M^MAnimation 12: FadeIn(VGroup of 5 submobjects):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 12: FadeIn(VGroup of 5 submobjects):  75%|#######5  | 9/12 [00:00<00:00, 84.10it/s]^M                                                                                             ^M^MAnimation 13: _MethodAnimation(VGroup of 5 submobjects):   0%|          | 0/30 [00:00<?, ?it/s]^MAnimation 13: _MethodAnimation(VGroup of 5 submobjects):  30%|###       | 9/30 [00:00<00:00, 83.32it/s]^MAnimation 13: _MethodAnimation(VGroup of 5 submobjects):  60%|######    | 18/30 [00:00<00:00, 84.20it/s]^MAnimation 13: _MethodAnimation(VGroup of 5 submobjects):  90%|######### | 27/30 [00:00<00:00, 83.80it/s]^M                                                                                                        ^M^MAnimation 14: Transform(VMobject):   0%|          | 0/12 [00:00<?, ?it/s]^MAnimation 14: Transform(VMobject):  92%|#########1| 11/12 [00:00<00:00, 104.76it/s]^M                                                                         
E121: Odefinierad variabel: b:gitbranch
E121: Odefinierad variabel: b:current_function
E121: Odefinierad variabel: b:num_warnings
E121: Odefinierad variabel: b:num_errors

I am using gvim in Windows 10.

I have no problem in running the same script with gvim under WSL (Ubuntu).

10
  • Post all the errors, please.
    – romainl
    Commented Apr 8 at 18:42
  • >C:\Users\yt75534\AppData\Local\Temp\VLX2AAD.tmp 2>&1 this doesn't look valid for the windows shell. See :help 'shellpipe' (Edit: this might be right unless you use Powershell?)
    – D. Ben Knoble
    Commented Apr 8 at 20:35
  • @romainl added all errors and vimrc.
    – Barzi2001
    Commented Apr 8 at 21:51
  • @D.BenKnoble I have &shell = C:\WINDOWS\system32\cmd.exe
    – Barzi2001
    Commented Apr 8 at 21:52
  • 1
    Please post solutions in the “Answer” box below, not in comments :)
    – D. Ben Knoble
    Commented Apr 9 at 16:37

1 Answer 1

0

TLDR; The problem has been solved by adding the conda path to the user PATH environment variable.

Although the problem was not related to Vim itself, Vim behaved in a very strange way, so it may be worth mentioning what happened.

  • With shell left as default, which means cmd.exe, the rendering process succeeded but it followed a number of E282 errors followed by a bunch of E121 errors. Again: the make command was executed correctly. Inspection :h E282 and :h121 didn't lead anywhere.
  • With shell set as pwsh the rendering process failed and I get E40 instead. Inspection of :h E40 provided more insights and it proposed some solutions. However, none of the solutions provided solved my problem.

The different errors reported by the different shells was something interesting though.

I tried to run the command specified in makeprg manually in a powershell and it worked fine.

Then, I tried to run the makeprg command again but from a cmd.exe shell. I got a 'manim' is not recognized as an internal or external command, operable program or batch file' error. I thought that the cmd.exe shell was pointing to the wrong virtual environment, so I tried to change it but then I got 'conda' is not recognized as an internal or external command, operable program or batch file'. I was surprised that conda was recognized in powershell but in cmd.exe. To fix it, I added the installation path of conda to my user PATH environment variable. I tried to run make again from Vim and everything worked perfectly.

Hence, the problem was on the system setup side (conda not recognized in cmd.exe), and not Vim, but given that Vim shell is cmd.exe I would expected a 'manim' is not recognized ... error instead of a successful rendering process followed by a bunch on E282 and E121. Furthermore, I expected the rendering to succeed when shell=pwsh as manim is recognized by the powershell but the rendering failed and I got E40 error instead. All that was very confusing and nasty, but the problem now seems to be solved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.