I’m trying to get my app working on Windows and I can’t figure out what the issue is. Everything works flawlessly on Linux(Xubuntu) but when I’m trying to run my app on Windows I’m constantly getting these errors. It looks like Phoenix can’t spawn python3 instances, but I don’t know why. I am 100% sure that python3 is installed and matches the path that Phoenix is trying to use.
Hasn’t anyone run into a similar issues on Windows?
Any ideas?
You made sure environment variable was set by printing them using command set in command prompt? If it is not reflecting you can open new command prompt or powershell.
This is weird - ERLPORT_PYTHON picks up everytime I set and restart iex.
c:\Users\Jiri\Desktop\Phoenix\Pluto\phx>mix phx.server
[warning] Phoenix is unable to create symlinks. Phoenix' code reloader will run considerably faster if symlinks are allowed. On Windows, the lack of symlinks may even cause empty assets to be served. Luckily, you can address this issue by starting your Windows terminal at least once with "Run as Administrator" and then running your Phoenix application.
[info] Running PlutoWeb.Endpoint with cowboy 2.9.0 at 127.0.0.1:4000 (http)
[info] Access PlutoWeb.Endpoint at http://localhost:4000
[debug] QUERY OK db=16.0ms idle=16.0ms
SELECT * FROM get_all_settings() []
[debug] Maid started to clean images
[debug] %Postgrex.Query{cache: :reference, columns: nil, name: "", param_formats: nil, param_oids: nil, param_types: nil, ref: nil, result_formats: nil, result_oids: nil, result_types: nil, statement: "SELECT get_all_photos()", types: nil} uses unknown oid(s) 29239forcing us to reload type information from the database. This is expected behaviour whenever you migrate your database.
[debug] QUERY OK db=0.0ms queue=15.0ms idle=63.0ms
SELECT get_all_photos() []
[warning] Could not get files from upload directory. reason: :enoent. path: c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/_build/dev/lib/pluto/priv/upload
[info] Maid finished cleaning task (thumbnails enqueued)
[error] GenServer #PID<0.566.0> terminating
** (stop) :enoent
erlang.erl:2217: :erlang.open_port({:spawn, 'c:\\Users\\Jiri\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe -V'}, [{:line, 80}, :stderr_to_stdout, :hide])
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/erlport_options.erl:227: :erlport_options.get_version/1
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/python_options.erl:177: :python_options.check_python_version/1
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/python_options.erl:161: :python_options.find_python/1
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/python_options.erl:146: :python_options.get_python/1
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/python_options.erl:88: :python_options.parse/2
(erlport 0.10.1) c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/deps/erlport/src/python.erl:168: :python.start/3
(pluto 0.1.0) lib/pluto/image/pil_worker.ex:112: Pluto.Image.PilWorker.handle_info/2
(stdlib 3.12) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib 3.12) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib 3.12) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:create_port, "c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/_build/dev/lib/pluto/priv/python"}
State: %{arg: "c:/Users/Jiri/Desktop/Phoenix/Pluto/phx/_build/dev/lib/pluto/priv/python", max_size: nil, port: nil}
I have also tried placing the environment variable in system settings
I’ll give it a go on Monday, sadly, I’m out of the office and I have no issues with my laptop, which runs on Linux.
I am pretty sure it will not work, there’s something wrong with Python installed via WindowsApps.
I’ve been told to install Python through an external source, which is supposed to fix the issue.
Thanks for your help, I’ll give you an update on Monday!