cloudflare / python-worker-hello-world

Python hello world for Cloudflare Workers
Apache License 2.0
276 stars 48 forks source link

Wrangler publish fails on Windows 10 due to incorrect python command #1

Closed 12932 closed 4 years ago

12932 commented 4 years ago

I've installed virtualenv, and transcrypt within that env, however, wrangler publish seems to be running a command that fails

⬇️ Installing wranglerjs...
⬇️ Installing wasm-pack...
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640Error compiling C:\Users\admin\wranglers\pythonhelloworld\index.py:
 ./index.py
Module build failed (from ./node_modules/transcrypt-loader/__target_es5__/index.js):
Error: Command failed: python3 -m transcrypt --nomin --map --verbose "index"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
    at checkExecSyncError (child_process.js:611:11)
    at Object.execSync (child_process.js:647:15)
    at Object.main (C:\Users\admin\wranglers\pythonhelloworld\node_modules\transcrypt-loader\__target_es5__\index.js:56:67)
Error: webpack returned an error. Try configuring `entry` in your webpack config relative to the current working directory, or setting `context = __dirname` in your webpack config.

On Windows 10, it's normal for python3 to be ran as python, when it's installed from the installer from https://www.python.org/downloads/

How can I force wrangler to use python instead of python3?

koeninger commented 4 years ago

Closing this in favor of #2