[RE]你能看到我的 pyinstaller 错误吗?没有EXE文件

[RE]Can you see my pyinstaller error. There is no EXE file

我想用附带的py文件制作exe。 一些测试 py 文件形成了 exe 并且运行良好。(使用 pyinstaller)

但是我不知道为什么附件py文件不能转换成EXE文件

所以,请尝试转换exe文件并反馈我错误的地方。

(由于公司站点原因,此文件无法在您的计算机上运行。这是用于在网络浏览器上实现自动化的 py 文件。)

Creating py file using PYCHARM / Making exe file using pyinstaller on the Anaconda Powershell Prompt (Anaconda3)

** 我想告诉你提示错误,你可以简单地看到。但我不知道哪个错误对制作exe至关重要。所以,我附上了完整的提示信息。感谢您的理解。

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
#from selenium.webdriver.common.action_chains import ActionChains
import time
from openpyxl import load_workbook
#from pywinauto.application import Application
#import win32com.client
import os.path

driver = webdriver.Chrome('C:/Temp/chromedriver')
driver.get('https://s1-eu.ariba.com/gb/toapprove/todos?realm=FAURECIASERVICESGROUPE&realm=FAURECIASERVICESGROUPE&locale=ko')

WB = load_workbook('C:\Temp\ARIBA_PR.xlsx',data_only=True)
WS = WB['Sheet1']

Number_of_total_data = WS.cell(1,1).value
R_Number_of_total_data = range(Number_of_total_data)
print(Number_of_total_data)
print(R_Number_of_total_data)

driver.implicitly_wait(300)

for i in (R_Number_of_total_data) :

    i += 1

    WebDriverWait(driver, 100).until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, '#fd-shellbar__logo')))
    driver.find_element_by_css_selector('#fd-shellbar__logo').click()

    WebDriverWait(driver, 100).until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, '#gbsection > div.row > aside > div > div.non-quick-link-panel > div:nth-child(1) > div > a')))
    driver.find_element_by_css_selector('#gbsection > div.row > aside > div > div.non-quick-link-panel > div:nth-child(1) > div > a').click()

    WebDriverWait(driver, 100).until(expected_conditions.visibility_of_element_located((By.XPATH, '//*[@id="gbsection"]/adhoc-checkout-form-new/main/gb-action-bar/div/div/div/div[2]/div[1]/div[2]/div/button[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[1]/div[1]/div/field/div/div[1]/div/ng-include/input').send_keys(WS.cell(i+2,1).value)
    time.sleep(1)

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[1]/div[2]/div/field/div/div[1]/div/ng-include/div[1]/button').click()
    time.sleep(1)
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[1]/div[2]/div/field/div/div[1]/div/ng-include/div[1]/ul/li[13]/div/a').click()
    time.sleep(1)
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[1]/div[2]/div/field/div/div[1]/div/ng-include/div[2]/div/div/div/div/div[2]/form/div/input').send_keys(WS.cell(i+2,2).value, Keys.ENTER)
    time.sleep(1)
    driver.find_element_by_css_selector('#tree-root > ol > li > ol > li > ol > li > ol > li > table > tbody > tr > td.choose-button > button').click()
    time.sleep(1)

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[2]/div[1]/div/div/div/field/div/div[1]/div/ng-include/div/textarea').send_keys(WS.cell(i+2,3).value)

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[2]/div[2]/div/ul/li[1]/field/div/div[1]/div/ng-include/div/div/input').send_keys(WS.cell(i+2,4).value)
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/adhoc-checkout-form-new/main/div/div[1]/div[2]/div/div[2]/div[2]/div/ul/li[3]/field/div/div[1]/div/ng-include/div/input').send_keys(WS.cell(i+2,5).value)

    driver.find_element_by_css_selector('#gbsection > adhoc-checkout-form-new > main > gb-action-bar > div > div > div > div.fd-action-bar__header > div.req-title.gb-action-title > div.fd-action-bar__actions > div > button.btn-medium.pull-right.btn-primary').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))

    #WebDriverWait(driver, 300).until(expected_conditions.visibility_of_element_located((By.XPATH, '//*[@id="shopping-cart-submit-button"]')))
    driver.find_element_by_css_selector('#shopping-cart-submit-button').click()
    WebDriverWait(driver, 300).until(expected_conditions.visibility_of_element_located((By.XPATH, '//*[@id="gbsection"]/div[1]/gb-action-bar/div/div/div/div[2]/div[1]/div[2]/div/button[2]')))

    driver.find_element_by_css_selector('#NeedBy > div.form-group.error > div > ng-include > div > input').send_keys(WS.cell(i+2,6).value)
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))

    driver.find_element_by_css_selector('#cus_ControllerField > div.form-group.error > div > ng-include > div.field-chooser.dropdown > button').click()
    driver.find_element_by_css_selector('#cus_ControllerField > div.form-group.error > div > ng-include > div.field-chooser.dropdown.open > ul > li:nth-child(2) > a').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[1]/div/div[2]/field/div/div[1]/div/ng-include/div[1]/button').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[1]/div/div[2]/field/div/div[1]/div/ng-include/div[1]/ul/li[13]/div/a').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[1]/div/div[2]/field/div/div[1]/div/ng-include/div[2]/supplier-chooser-modal/div/div/div/div/div[2]/form/div/input').send_keys(WS.cell(i+2,7).value, Keys.ENTER)
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[1]/div/div[2]/field/div/div[1]/div/ng-include/div[2]/supplier-chooser-modal/div/div/div/div/div[2]/div/table/tbody/tr[2]/td[7]/button').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[2]/div/field[5]/div/div[1]/div/ng-include/div[1]/button').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[2]/div/field[5]/div/div[1]/div/ng-include/div[1]/ul/li[5]/div/a').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[2]/div/field[5]/div/div[1]/div/ng-include/div[2]/div/div/div/div/div[2]/div/div[1]/form/div[2]/input').send_keys(WS.cell(i+2,8).value, Keys.ENTER)
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[3]/div[3]/div/div[1]/line-item-new/div[1]/div[3]/div[2]/div/field[5]/div/div[1]/div/ng-include/div[2]/div/div/div/div/div[2]/div/div[2]/div[2]/table/tbody/tr[2]/td[3]/button').click()
    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[4]/gb-comment/div/div[2]/div/div/div/div[1]/textarea').send_keys(WS.cell(i+2,3).value)
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[4]/gb-comment/div/div[2]/div/div[1]/div/div[2]/button').click()

    for(path,dir,files) in os.walk("\\kryngfls0002.ls.ege.ds\share\Testing\T02_Test_report\T02.16_Test report_2021"):
        for filename in files:
            if filename == WS.cell(i+2,9).value:
                Report_path = path+'\'+filename

    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[4]/gb-attachment/div/div[2]/div/div/div/div[1]/div[1]/div[1]/label/input').send_keys(Report_path)

    WebDriverWait(driver, 100).until(expected_conditions.visibility_of_element_located((By.XPATH, '/html/body/div[1]/app-root/div[3]/ui-view/section/div[4]/gb-attachment/div/div[2]/div/div/div/div[1]/div[1]/div[2]/span/i')))
    driver.find_element_by_xpath('/html/body/div[1]/app-root/div[3]/ui-view/section/div[4]/gb-attachment/div/div[2]/div/div/div/div[2]/button').click()

    WebDriverWait(driver, 300).until(expected_conditions.invisibility_of_element((By.XPATH, '/html/body/span[1]')))
    driver.find_element_by_xpath('/htmls/body/div[1]/app-root/div[3]/ui-view/section/div[1]/gb-action-bar/div/div/div/div[2]/div[1]/div[2]/div/button[1]').click()

我选择疑似错误

ImportError: DLL load failed while importing _win32sysloader: %1 is not a valid Win32 application.
ImportError: DLL load failed while importing _win32sysloader: %1 is not a valid Win32 application.
519014 INFO: Excluding import of gevent.testing.errorhandler from module gevent
519023 INFO: Excluding import of gevent.testing.errorhandler from module gevent.testing
519055 INFO: Excluding import of gevent.testing.errorhandler from module gevent.testing.testcase
519062 INFO: Excluding import of gevent.testing from module gevent.testing.errorhandler
519118 INFO: Excluding import of gevent.testing.sysinfo from module gevent.tests.test__socket_errors
519118 INFO: Excluding import of gevent.testing.support from module gevent.tests.test__socket_errors
519157 INFO: Excluding import of gevent.testing from module gevent.tests.test__systemerror
519253 INFO: Excluding import of gevent.tests.test__socket_errors from module gevent
519279 INFO: Excluding import of gevent.tests.test__systemerror from module gevent
519368 INFO: Excluding import of gevent.tests from module gevent.tests.test__socket_errors
519391 INFO: Excluding import of gevent.tests from module gevent.tests.test__systemerror
608703 WARNING:   Reason: 'DOS Header magic not found.'
Traceback (most recent call last):
  File "C:\Users\ahnsangh\AppData\Roaming\Python\Python38\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
    yield
  File "C:\Users\ahnsangh\AppData\Roaming\Python\Python38\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
    return _dll._LoadLibraryEx(fileName, 0, flags)
  File "C:\Users\ahnsangh\AppData\Roaming\Python\Python38\site-packages\win32ctypes\core\cffi\_dll.py", line 23, in _LoadLibraryEx
    result = check_null(
  File "C:\Users\ahnsangh\AppData\Roaming\Python\Python38\site-packages\win32ctypes\core\cffi\_util.py", line 81, in __call__
    self._raise_error(function_name)
  File "C:\Users\ahnsangh\AppData\Roaming\Python\Python38\site-packages\win32ctypes\core\cffi\_util.py", line 92, in _raise_error
    raise exception
OSError: [WinError 2] The system cannot find the file specified

我有 PyInstaller:3.5 和 Python:3.7.4。

我使用您提供的源创建了一个 test.py 文件。

然后在 cmd 行中我使用了命令“pyinstaller test.py”

exe 和相关文件在 dist 文件夹中创建。