找不到webdriverprefs.json-pyinstaller [英] webdriverprefs.json not found - pyinstaller

查看:277
本文介绍了找不到webdriverprefs.json-pyinstaller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用selenium包的python程序,当使用pyinstaller从中创建exe时,它将正确创建该exe.尝试从此应用程序打开firefox时,出现以下错误:

I have a python program which uses selenium package, and when creating an exe from this using pyinstaller it creates the exe correctly. When trying to open firefox from this app I got the following error:


IOError: [Errno 2] No such file or directory:
'C:\\users\\mohamed\\Temp\\_MEI622\\selenium\\webdriver\\firefox\\webdriver_prefs.json'

我找到了这个解决方案,但是对我来说不起作用

I found this solution, but it doesn't work for me:

Py2exe不会将webdriver_prefs.json复制到内部版本中

有什么想法吗?

推荐答案

我找到了相同的解决方案, 将脚本冻结为exe时不使用--onefile,而是使用--onedir,它将为所有文件生成一个文件夹,然后将路径c:\ python27 \ lib \ site-packages \ selenium中的selenium文件夹复制到您的应用程序文件夹中并且可以正常工作

I found a solution for same, when freezing scripts to exe don't use --onefile , use --onedir instead , it will generate one folder for all files and then copy selenium folder in path c:\python27\lib\site-packages\selenium to your app folder and it works correctly

这篇关于找不到webdriverprefs.json-pyinstaller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆