# "Unable to create process" error

**URL:** <https://discuss.python.org/t/unable-to-create-process-error/23451>\
**Category:** Python Help\
**Created:** [February 2, 2023, 4:34pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451 "2023-02-02T16:34:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simbinha](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/simbinha/32/10933_2.png) [@Simbinha](https://discuss.python.org/u/Simbinha)\
**Post date:** [February 2, 2023, 4:34pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/1 "2023-02-02T16:34:33Z")

</div>

Hello, i’m quite a newbie to Python myself and i’m trying to progress in this but can’t seem to make it work. I’m trying to use a MediaFire folder scraper (mf-dl) to download multiple files simultaneously. Everything has run fine up to the point i’m right now - installation is ok, PATH is set, requirements and pip were already run.

But when i get to executing the .py command i need i get a “Unable to create process using ‘C:\bin\env py mfdl.py output links.csv’: System could not find file.” error.

I’m actually a bit unsure on what this means. It seems like it is trying to run or execute the command from a C:\bin\env folder which does not exist, but i am inside the designated folder i want to use [plus, i have executed pip inside the same folder]. What does seem to be the problem here, and how can i progress from here?

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [February 2, 2023, 6:05pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/2 "2023-02-02T18:05:18Z")

</div>

env is a unix program not a windows one. Are you following instructions for Linux system by any chance?

Try with a command line like this:

```auto
py.exe mfdl.py output links.csv

```

---

<div class="post-metadata">

**Author:** ![eryksun](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eryksun/32/697_2.png) [@eryksun](https://discuss.python.org/u/eryksun)\
**Post date:** [February 2, 2023, 6:25pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/3 "2023-02-02T18:25:46Z")

</div>

The script [“mfdl.py”](https://gitgud.io/Pyxia/mf-dl/-/blob/master/mfdl.py#L1) has an unusual shebang command, “#!/bin/env”. We support “#!/usr/bin/env” virtual shebangs in the py launcher on Windows, which is the normal path that’s used for the “env” program. You can open an issue to support “#!/bin/env” virtual shebangs in the new launcher that’s distributed with Python 3.11 and later.

As a workaround, edit “mfdl.py” to change it to use either “#!/usr/bin/env python3” or “#!/usr/bin/python3”.

> [@barry-scott](#):
>
> ```auto
> py.exe mfdl.py output links.csv
> 
> ```

That won’t help. The py launcher mishandles the shebang line in “mfdl.py”.

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [February 2, 2023, 6:53pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/4 "2023-02-02T18:53:31Z")

</div>

> [@eryksun](#):
>
> That won’t help. The py launcher mishandles the shebang line in “mfdl.py”.

Would this stop py.exe looking at the shebang?

```auto
py.exe -3 script.py

```

---

<div class="post-metadata">

**Author:** ![eryksun](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eryksun/32/697_2.png) [@eryksun](https://discuss.python.org/u/eryksun)\
**Post date:** [February 2, 2023, 7:02pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/5 "2023-02-02T19:02:48Z")

</div>

> [@barry-scott](#):
>
> Would this stop py.exe looking at the shebang?
> 
> ```auto
> py.exe -3 script.py
> 
> ```

Yes, using `-3` should skip reading the shebang. However, one won’t be able to run the script from `PATH`. I assume “mfdl.py” isn’t located in the current directory that contains “links.csv” and where the “output” directory is created, so it would have to be run as `py -3 "full\path\to\mfdl.py" output links.csv`. It’s probably simpler in general to just modify the shebang to be able to run `mfdl output links.csv`.

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [February 2, 2023, 7:09pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/6 "2023-02-02T19:09:51Z")

</div>

> [@eryksun](#):
>
> It’s probably simpler in general to just modify the shebang to be able to run `mfdl output links.csv`.

Agreed. I have never seen #!/bin/env used as far as I can recall.

---

<div class="post-metadata">

**Author:** ![cameron](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cameron/32/2658_2.png) [@cameron](https://discuss.python.org/u/cameron)\
**Post date:** [February 2, 2023, 9:15pm UTC](https://discuss.python.org/t/unable-to-create-process-error/23451/7 "2023-02-02T21:15:20Z")

</div>

I used to have a portability issue with `env` on some older systems; I’m  
pretty sure I _have_ had to hand add a `/usr/bin/env` symlink on some  
older systems where `env` was only in `/bin`.

Personally, I’d advocate for supporting both - seems trivial, even if  
such systems are now very rare.

Cheers,  
Cameron Simpson [cs@cskk.id.au](mailto:cs@cskk.id.au)
