0

I have a fully working script in Python 3.5. I tried running it on PyPy3 to see the speedups, but PyPy3 won't recognize a command which is clearly in the HOME environment variable

C:\Users\me\Desktop\PdfConc>where pdftotext
C:\Windows\me\pdftotext.exe

C:\Users\me\Desktop\PdfConc>pypy3
Python 3.5.3 (fdd60ed87e94, Apr 24 2018, 06:27:13)
[PyPy 6.0.0 with MSC v.1910 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> from os import system
>>>> system("pdftotext")
'pdftotext' is not recognized as an internal or external command,
operable program or batch file.

any ideas why it's doing that?

Muhammad Ali
  • 712
  • 7
  • 14
  • Do you mean the ``PATH`` environment variable? – Armin Rigo May 29 '18 at 07:35
  • @ArminRigo Yes! pdftotext is in my $PATH$, but for some reason pypy can't find it... – Muhammad Ali May 29 '18 at 07:59
  • It works for me on Windows. Can you give a step-by-step guide so that we can reproduce the problem? In this case, it would be something like "make a directory c:\foobar, copy an executable in it, set your PATH to exactly this, run pypy3 from there". If I'm doing this naively it works for me, so please try to isolate what could be different in your case. – Armin Rigo May 30 '18 at 18:14
  • @ArminRigo that is exactly what I did. pypy is in C drive. I added the folder to my PATH variable. Now, pypy works when invoked from command line, pdftotext also works when invoked from command line, BUT when I invoke pdftotext from inside pypy3 using system(), that gives me the error I described... – Muhammad Ali May 30 '18 at 20:12
  • Maybe run from pypy3 ``system("cmd")``, and in that shell, look if PATH is still what you want? In that shell, does typing ``pdf2text`` work? – Armin Rigo May 31 '18 at 06:17

0 Answers0