pyinstaller

pyinstaller No module named grpc

♀尐吖头ヾ 提交于 2021-01-22 04:47:51
问题 My goal is to build an executable using pyinstaller. The python script I am trying to build imports grpc. The following is an example that illustrates the problem called hello.py. import grpc if __name__ == '__main__': print "hello world" I do pyinstaller hello.py and that produces the expected dist directory. Then I run it like ./dist/hello/hello and I get error ImportError: No module named grpc. So then I installed grpc using pip install grpc . When I rebuild the artifact I now get error

pyinstaller No module named grpc

£可爱£侵袭症+ 提交于 2021-01-22 04:47:32
问题 My goal is to build an executable using pyinstaller. The python script I am trying to build imports grpc. The following is an example that illustrates the problem called hello.py. import grpc if __name__ == '__main__': print "hello world" I do pyinstaller hello.py and that produces the expected dist directory. Then I run it like ./dist/hello/hello and I get error ImportError: No module named grpc. So then I installed grpc using pip install grpc . When I rebuild the artifact I now get error

Could not find the matplotlib data files

蓝咒 提交于 2021-01-02 06:12:58
问题 I am new to python and I am trying to create an .exe from py script with pyinstaller but I get this error when trying to run the .exe: Could not find the matplotlib data files. When i run the script in python idle i dont get this error. I've tried: import matplotlib setup( data_files=matplotlib.get_py2exe_datafiles(), ) But i get an error saying that setup is not defined. 回答1: I've fixed the problem by downgrading matplotlib to version 3.0.3 Using this command: python -m pip install

Python 3 代码打包可执行文件EXE

倖福魔咒の 提交于 2021-01-01 19:54:46
我们写好的代码.py源文件,打包成EXE可执行文件,这样即使在没有安装Python的电脑上也可以执行。使用pyinstaller,参数如下(该命令直接在CMD命令提示符中运行): 常用参数讲解 -F 表示生成单个可执行文件 -w 表示去掉控制台窗口,这在GUI界面时非常有用(用于windows系统) -p 表示你自己自定义需要加载的类路径,一般情况下用不到 -i 表示可执行文件的图标 -c 使用控制台,无窗口 -D 创建一个目录,里面包含exe以及其他一些依赖性文件 -h 来查看参数 注意事项 .py的源文件命名最好用英文命名,不然有可能打包失败出错 pyinstaller -F -i d:\Python_tool\09扩容脚本\kr.ico d:\Python_tool\09扩容脚本\自动扩容.py 如上,源代码文件使用的中文名,打包失败: 将源代码文件改成英文再次尝试 pyinstaller -F -i d:\Python_tool\09扩容脚本\kr.ico d:\Python_tool\09扩容脚本\Ce.py 打包EXE可执行文件成功: 生成的可执行文件保存在C:\Users(用户)\用户名(当前登录电脑用户名)\dist 目录下 : 最后祝大家国庆快乐,国庆假期间暂停更新文章,调整一下,肝了快两月了,当前情况来看,公众号运营的不是很理想,主要是没有太多时间精心打理

Python: pyinstaller打包exe(含file version信息)

只谈情不闲聊 提交于 2020-12-31 11:08:13
最近项目上一直都是用Spyder直接运行.py文件的方式来执行每日的自动化程序,每天都要手动去点击Run来执行一次,所以考虑把.py文件直接打包成exe,然后用windows的task schedule功能来让它自动每天运行。 用pyinstaller来打包exe文件,同时为了便于维护,给exe文件添加文件版本file version信息。 1. 安装pyinstaller 机器上的python环境是直接安装的Anaconda软件,所以直接打开“Anaconda Prompt”来安装pyinstaller,运行命令:pip install pyinstaller。(如果提示有其他相关的组件xxxx缺失,用相应的方式来安装就好: pip install xxxx) 2. 设置文件版本信息 为了方便版本管控,最好是给每次打包发布的exe文件设置文件版本信息——右键点击exe查看属性中的详情信息中可以看到版本信息。 方法一: 进入pyinstaller的此目录\PyInstaller\utils\cliutils\下(如果不知道路径可以通过去全盘查询cliutils来找到相应的文件夹,此处安利一款window上的文件查询小软件——Everything: https://www.voidtools.com/zh-cn/downloads/ ,查询速度超级快!) 你会看到如下几个文件:

Converting a python 3.8 file to .exe

杀马特。学长 韩版系。学妹 提交于 2020-12-31 05:02:30
问题 I've been trying to do so for a while. I followed a tutorial which said you should install pyinstaller first. So, I installed it. Then it said you should write pyinstaller --onefile -w file_name.py in cmd. I had an issue with that as well (there was an error). So, I installed another version of pyinstaller. I wrote the same thing, but no .exe file was created, only a new folder named " pycache " with a new .pyc file inside (I suppose it's a version of the file I wanted to turn into .exe).

Converting a python 3.8 file to .exe

做~自己de王妃 提交于 2020-12-31 05:01:22
问题 I've been trying to do so for a while. I followed a tutorial which said you should install pyinstaller first. So, I installed it. Then it said you should write pyinstaller --onefile -w file_name.py in cmd. I had an issue with that as well (there was an error). So, I installed another version of pyinstaller. I wrote the same thing, but no .exe file was created, only a new folder named " pycache " with a new .pyc file inside (I suppose it's a version of the file I wanted to turn into .exe).

spacy 2.2.3 FileNotFoundError: [Errno 2] No such file or directory: 'thinc\\neural\\_custom_kernels.cu' in pyinstaller

时光总嘲笑我的痴心妄想 提交于 2020-12-30 12:07:36
问题 I was trying to create a executable file using pyinstaller. I got bellow issue while executing the issue. File "test_env2_live\main.py", line 2, in <module> File "C:\Users\rajesh.das\AppData\Local\Continuum\anaconda3\envs\test_env2\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module exec(bytecode, module.__dict__) File "test_env2_live\controller\main.py", line 2, in <module> File "C:\Users\rajesh.das\AppData\Local\Continuum\anaconda3\envs\test_env2\lib\site

spacy 2.2.3 FileNotFoundError: [Errno 2] No such file or directory: 'thinc\\neural\\_custom_kernels.cu' in pyinstaller

梦想的初衷 提交于 2020-12-30 12:01:06
问题 I was trying to create a executable file using pyinstaller. I got bellow issue while executing the issue. File "test_env2_live\main.py", line 2, in <module> File "C:\Users\rajesh.das\AppData\Local\Continuum\anaconda3\envs\test_env2\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module exec(bytecode, module.__dict__) File "test_env2_live\controller\main.py", line 2, in <module> File "C:\Users\rajesh.das\AppData\Local\Continuum\anaconda3\envs\test_env2\lib\site

Getting error when using pynput with pyinstaller

故事扮演 提交于 2020-12-30 03:00:52
问题 A friend of mine asked me to write him a program, and I used pynput to handle some of the inputs and other features. When I convert the program an executable with pyinstaller, launcing the executable gives me this error: File "site-packages\pynput\keyboard\__init__.py", line 31, in <module> File "site-packages\pynput\_util\__init__.py", line 82, in backend ImportError [11492] Failed to execute script friend_project I have tried using the pyinstaller command pyinstaller --onefile friend