我希望使用.exe将我的python文件转换为pyinstaller文件。我已经使用pip install pyinstaller安装了pyinstaller,但是当我尝试使用pyinstaller时,我得到:
C:\Users\Varnith\Desktop\program>pyinstaller --onefile main.py
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.
我做了一个程序,我想增加一个更新系统。它检查网站是否有任何更新,如果有更新,它会下载新文件并覆盖自身的新文件。
.py文件工作正常。它通过os.unlink方法删除自己,并保存新文件而不是旧文件。然后,它打开新版本并自行关闭。但是,当我运行它的.exe文件(pyinstaller)时,我得到了这个错误:
WindowsError: [Error 32] The process cannot access the file because it is being used by another process
我该怎么解决它呢?
编辑:我通过pyinstaller将其转换为exe文件,并输入以下
我真的不知道还能做什么,这样我就可以在.exe中编译我的项目了。尝试了许多教程,包括我在这里和github上找到的一个,但都没有成功。
i使用pycharm社区版本2021.1
我的cmd:
Microsoft Windows [versão 10.0.19042.985]
(c) Microsoft Corporation. Todos os direitos reservados.
C:\WINDOWS\system32>python -m pip install pyinstaller
Requirement already satisfied: pyinstaller in c
我想从使用pyinstaller编译的python文件中执行exe文件。
我使用以下代码:
import subprocess, os, sys
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
ba
我已经用python3.5写了一个脚本。我已经用pyinstaller制作了一个.exe文件。该脚本具有一些打印语句,这些语句在执行期间显示在控制台中。当我从命令提示符运行脚本时,我可以在命令提示符中看到所有消息,但是当我从命令提示符运行.exe文件时,我在命令提示符中看不到任何消息。有没有办法从.exe文件中查看命令提示符中的消息。
例如,假设下面是我的名为abc.py的脚本:
def sum():
first = 5
print('First number is {}'.format(first))
second = 10
result = firs
我试图从终端构建一个通过PyInstaller利用状态模型的exe文件。exe文件是由PyInstaller构建的,没有错误--但是当运行时,我会得到以下错误:
ModuleNotFoundError: No module named 'statsmodels.__init__._version'
我尝试过在PyInstaller“钩子”目录中安装statsmodel钩子,就像描述的那样,但是这不起作用。我还尝试在我的Python代码中显式导入statsmodels.init._version,但这也不起作用。下面是我导入包的代码的顶部:
import pandas as pd