pyinstaller

Branca Python module is unable to find 2 essential json files when running an executable that uses folium

旧巷老猫 提交于 2020-05-14 07:09:06
问题 There is a chance this is still a problem and the Pyinstaller and/or Folium people have no interest in fixing it, but I'll post it again here in case someone out there has discovered a workaround. I have a program that creates maps, geocodes etc and recently added the folium package to create some interactive maps in html format. I always compile my code using pyinstaller so that others at my company can just use the executable rather than running the python code. If I run my code in an IDE,

Using Pyinstaller with NLTK results in error: can't find nltk_data

≡放荡痞女 提交于 2020-05-14 03:46:13
问题 I am attempting to export a simple GUI that used NLTK as an exe with Python 3.6 and Windows 10. When I run PyInstaller to freeze my simple program as an exe I get the error: Unable to find "c:\users\usr\nltk_data" when adding binary and data files. When I even copied the nltk_data folder here and I get an error in a different nltk.data.path path "c:\users\usr\appdata\local\programs\python\python36\nltk_data" import tkinter as tk from nltk.corpus import stopwords sw = stopwords.words('english'

Pyinstaller and sklearn.ensemble: 'ModuleNotFoundError: No module named 'sklearn.neighbors.quad_tree' [2760]'

淺唱寂寞╮ 提交于 2020-05-13 18:55:25
问题 I have written a GUI in PyQt5 which includes the line from sklearn.ensemble import RandomForestClassifier . Following the suggestion in this answer, in \Anaconda3\Lib\site-packages\PyInstaller\hooks , I have added a file called hook-pandas.py which contains the following: hiddenimports = ['pandas._libs.tslibs.timedeltas', 'sklearn.neighbors.typedefs'] After that, I tried running pyinstaller -F visual_vitals.py --hidden-import sklearn.neighbors.typedefs in the Anaconda Prompt. However, I get

PyInstaller does not recognize downloaded pywin32

血红的双手。 提交于 2020-05-11 05:33:30
问题 I have downloaded Python 2.7.3, PyInstaller (compatible with 2.7) and pywin32 (compatible with 2.7) and restarted my machine, but when I enter the prompt: pyinstaller.py [opts] nameofscript.py The prompt then tells me: Error: PyInstaller for Python 2.6+ on windows needs pywin32. Please install from http://sourceforge.net/projects/pywin32/ Why is it that PyInstaller can't "see" that I have already downloaded pywin32? 回答1: If you are using Python 2.7, the compat.py in the C:/Python27/Lib/site

PyInstaller does not recognize downloaded pywin32

梦想的初衷 提交于 2020-05-11 05:32:52
问题 I have downloaded Python 2.7.3, PyInstaller (compatible with 2.7) and pywin32 (compatible with 2.7) and restarted my machine, but when I enter the prompt: pyinstaller.py [opts] nameofscript.py The prompt then tells me: Error: PyInstaller for Python 2.6+ on windows needs pywin32. Please install from http://sourceforge.net/projects/pywin32/ Why is it that PyInstaller can't "see" that I have already downloaded pywin32? 回答1: If you are using Python 2.7, the compat.py in the C:/Python27/Lib/site

PyInstaller does not recognize downloaded pywin32

人走茶凉 提交于 2020-05-11 05:32:19
问题 I have downloaded Python 2.7.3, PyInstaller (compatible with 2.7) and pywin32 (compatible with 2.7) and restarted my machine, but when I enter the prompt: pyinstaller.py [opts] nameofscript.py The prompt then tells me: Error: PyInstaller for Python 2.6+ on windows needs pywin32. Please install from http://sourceforge.net/projects/pywin32/ Why is it that PyInstaller can't "see" that I have already downloaded pywin32? 回答1: If you are using Python 2.7, the compat.py in the C:/Python27/Lib/site

The 'google-api-python-client' distribution was not found and is required by the application with pyinstaller

て烟熏妆下的殇ゞ 提交于 2020-05-07 09:23:38
问题 I am currently trying to build an app with pyinstaller. I have gotten the error The 'google-api-python-client' distribution was not found and is required by the application and I'm completely lost why. Running pip show google-api-python-client results with Name: google-api-python-client Version: 1.8.2 Summary: Google API Client Library for Python Home-page: http://github.com/google/google-api-python-client/ Author: Google LLC Author-email: googleapis-packages@google.com License: Apache 2.0

手把手教你使用Python生成图灵智能小伙伴,实现工作助手/闲聊功能

血红的双手。 提交于 2020-05-05 10:51:19
/1 前言/ 在家闲着,做个小项目,基于Python,实现一个语聊小机器人,分享给大家。项目整体比较简单,官方文档介绍的非常详细,可快速上手。 /2 目标/ 将图灵机器人放到桌面,实现工作助手/陪聊功能。 /3 涉及的库/ V1.0版本:requests、json V2.0版本:requests、json、selenium(实现功能:如图灵返回结果为url,则自动打开网页) /4 具体实现/ 1、创建图灵机器人 图灵机器人的创建在网上有很多方法,因创建图灵机器人非常简单且与Python无关,此处不赘述。 注意:创建机器人后需要认证才能享受每天100条的免费回复。 2、网上有很多API接入教程,如果想随便玩玩的话,用小编的代码就可以了,想实现更多,可以看看API文档。 3、认证成功后找到最关键的apiKey参数。 4、开始写代码了--V1.0版本 首先引入需要的库 import requests import json from selenium import webdriver url为官方文档中指定url url = 'http://openapi.tuling123.com/openapi/api/v2' 添加请求头 headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36

Jenkins简明入门(二) -- 利用Jenkins完成Python程序的build、test、deployment

让人想犯罪 __ 提交于 2020-05-02 04:02:37
大家可能还没搞清楚,Jenkins到底能做什么? 本节内容利用Jenkins完成python程序的build、test、deployment,让大家对Jenkins能做的事情有一个直观的了解。 本节内容改写自 https://jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/。 1. Fork,Clone Github上的sample repo 这个Github上的sample repo包含了python程序的Buid, Test , Depolyment的代码,所以我们需要先fork这个repo,然后clone到我们本地机器。 关于这段Python程序,也很简单,就是计算两个参数的和。repo中的代码包含了程序本体(计算和),还包含了unittest,build(通过Pyinstaller生成可执行文件)等一切需要的代码及工具   1.1 登录Github,如果没有的话,就去注册一个   1.2 在Github上Fork simple-python-pyinstaller-app , 如果不知道如何fork,请参考 Fork A Repo   1.3 Clone 这个 repo到本地机器,方法是:     打开Linux命令行     cd /home/<your-username>/GitHub/    

利用PyPDF2删除PDF文件首页

浪尽此生 提交于 2020-05-02 00:38:26
前话:有个朋友让我给他编辑他们公司的PDF文件,签名的日期时间不对,需要进(nong)行(xu)优(zuo)化(jia)。而我手上只有两个管理pdf的软件,一个福晰阅读器,还有一个福晰编辑器。但是阅读器只能阅读,所以只能用福析编辑器进行编辑了,虽然编辑起来很方便,但是免费版保存下多了一页首页广告。手上也没有其他pdf编辑软件能分页,就想着能不能用python写个小程序。后来发现有个PyPDF2第三方库可以拿来用。 下面以一个代码来说明: # !usr/bin/env python # coding:utf-8 from PyPDF2 import PdfFileReader, PdfFileWriter import time # 生成一个PdfFileWriter对象 pdf_new = PdfFileWriter() # 以交互形式输入需要处理的文件 pri_file = input( ' 请输入你要去掉首页的PDF文件: ' ) # 读取待处理的文件 pdf_input = PdfFileReader(open(pri_file, ' rb ' )) # 算出总页数 page_count = pdf_input.getNumPages() # 去掉首页后,把其余页添加到PdfFileWriter对象中 for i in range(1 , page_count): pdf