python: Can I run a python script without actually installing python?

后端 未结 6 643
臣服心动
臣服心动 2020-12-08 14:35

I have some .py files I wrote that I want to run on a different machine. The target machine does not have python installed, and I can\'t \'install\' it by policy. What I c

6条回答
  •  攒了一身酷
    2020-12-08 14:46

    This is an old question, but one alternative is creating a virtual environment for Python, which can be as simple as python -m venv myenvname (Python 3.4). You can "install" packages into it the normal way (e.g. pip) without needing anything else. You'll end up with a folder you can move/delete at your leisure.

提交回复
热议问题