pyinstaller: problem when using --key command
我正在尝试使用pyinstaller -F --key =" 123456" my.py加密exe,但是却收到此错误:
这是my.py的内容,不需要其他文件或数据:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import requests from bs4 import BeautifulSoup def get_page_source(page_num): print('Crawling page %d' % page_num) url = 'http://books.toscrape.com/catalogue/page-%d.html' % page_num r = requests.get(url) return r.text def get_book_info(page_source): soup = BeautifulSoup(page_source, features='lxml') titles = soup.select('h3 > a') for title in titles: print(title.get('title')) if __name__ == '__main__': # 1-50 for i in range(1, 51): page_source = get_page_source(i) get_book_info(page_source) |
没有任何关于如何解决它的线索。 当我停止使用--key命令时,它工作正常。
PyInstaller == 3.4 Python == 3.6
这是已知的错误,这是因为Pyinstaller加密与pycryptodome不兼容。 因此,您需要安装旧的PyCrypto才能使其正常工作。
这里有一个很好的答案,用于安装旧的
1 | pip install pycrypto |