问题描述
我想将我的python项目分发给其他人,以便他们可以运行它而无需在自己的PC(Windows)上安装python 3.4
I want to distribute my python project to others so that they can run it without installing python 3.4 on their PCs (windows)
我已经下载并解压缩了WinPython-32bit-3.4.4.6Qt5和WinPython-64bit-3.4.4.6Qt5软件包-在Spyder的帮助下-我运行python脚本没有任何问题(在2台不同的计算机上32位和64位窗口). (我将python脚本复制到settings/.spyder-py3文件夹中-并从spyder中打开了它).即使在未安装python的计算机上,此操作也可以.
I have downloaded and extracted both the WinPython-32bit-3.4.4.6Qt5 and WinPython-64bit-3.4.4.6Qt5 packages - and with the help of Spyder - I ran my python scripts without any problem (on 2 different machines with 32 and 64 bit windows). (I copied my python scripts into the settings/.spyder-py3 folder - and opened an run it from spyder). This worked OK even on machines where python is not installed.
但是,当我双击python脚本(扩展名为.py)时-我发现它不会自动开始运行. Windows要求我选择将运行/打开文件的程序.这在win7和win8上都在发生.
However, when I double click on the python script (with a .py extension) - I see that it does not start running automatically. Windows is asking me to select the program that shall run/open the file. This is happening both on win7 and win8.
这似乎很奇怪-因为昨晚它在具有不同版本的winPython(py版本3.5)的机器上运行正常.今天,即使是那个版本也无法使用.
This seems strange - because last night it worked OK on the machine with a different version of winPython (py version 3.5). Today even that version is not working.
在WinPython文档或网络上的任何其他地方都找不到与此有关的任何建议.
Cannot find any advice or suggestions regarding this on WinPython documentation or in any other place on the net.
我做错了什么? .py脚本不是应该在没有先调用Spyder的情况下运行吗?
What am I doing wrong? Aren't the .py scripts supposed to run without Spyder being invoked first?
任何帮助将不胜感激.
Any help shall be greatly appreciated.
推荐答案
确定.如果有人对我如何解决此主题感兴趣:
OK. If anyone is interested about how I solved this topic:
我必须在客户端计算机上执行winPython的寄存器分发"过程,以实现所需的功能.可以从与WinPython软件包一起分发的WinPython控制面板的高级菜单选项中访问它.
I had to perform winPython's 'Register Distribution' process on the client machine to achieve what I wanted. It can be accessed from the advanced menu option from the WinPython Control Panel that is distributed with the WinPython package.
(这在某种程度上将分布式python exe注册"到了客户端计算机,这使得该计算机中的所有.py文件都可以由winPython软件包随附的新python exe进行解释.)
(This somewhat 'registers' the distributed python exe to the clients computer - which enables all .py files in that computer to be interpreted by this new python exe delivered with the winPython package.)
我必须告诉我的客户执行此操作,然后他才能双击运行py文件.
I had to tell my client to perform this action before he could run the py files with a double click.
这篇关于WinPython无法直接运行.py文件(没有spyder)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!