AIHawk-co / Auto_Jobs_Applier

Auto_Jobs_Applier by AIHawk is an Agen that automates the jobs application process. Utilizing artificial intelligence, it enables users to apply for multiple jobs in an automated and personalized way.
Other
21.85k stars 3.2k forks source link

[BUG]: Error in Resume Generation: Missing Platform Module in Python Script #554

Open guschain opened 3 weeks ago

guschain commented 3 weeks ago

Describe the bug

When attempting to generate and upload a resume, the process fails with a NameError: name 'platform' is not defined. This error occurs in the create_driver_selenium() function, where the platform.system() call is made without importing the platform module. I have tried in Windows and Linux with WSL2 with the same result.

Steps to reproduce

When attempting to generate and upload a resume, the process fails with a NameError: name 'platform' is not defined. This error occurs in the create_driver_selenium() function, where the platform.system() call is made without importing the platform module.

Steps to Reproduce:

Trigger the resume generation process. Observe the error in the logs: name 'platform' is not defined. Expected Behavior: The resume should be generated and uploaded without errors.

Actual Behavior: The resume generation fails due to the missing platform module, resulting in an exception and preventing the resume from being uploaded.

Logs:

2024-10-17 00:32:02.828 | DEBUG    | src.llm.llm_manager:resume_or_cover:615 - Response for resume_or_cover: resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_handle_upload_fields:420 - Uploading resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_handle_upload_fields:425 - Resume path not found or invalid, generating new resume
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:434 - Starting the process of creating and uploading resume.
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:449 - Generated file path for resume: generated_cv\CV_1729121522.pdf
2024-10-17 00:32:02.828 | DEBUG    | src.aihawk_easy_applier:_create_and_upload_resume:451 - Generating resume for job: Brand Manager - Alzheimer - MBA (m/f/d) at Hays
2024-10-17 00:32:38.027 | ERROR    | src.aihawk_easy_applier:_create_and_upload_resume:480 - Failed to generate resume: name 'platform' is not defined
2024-10-17 00:32:38.028 | ERROR    | src.aihawk_easy_applier:_create_and_upload_resume:482 - Traceback: Traceback (most recent call last):
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\src\aihawk_easy_applier.py", line 452, in _create_and_upload_resume
    resume_pdf_base64 = self.resume_generator_manager.pdf_base64(job_description_text=job.description)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\manager_facade.py", line 81, in pdf_base64
    pdf_base64 = HTML_to_PDF(temp_html_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\utils.py", line 26, in HTML_to_PDF
    driver = create_driver_selenium()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Auto_Jobs_Applier_AIHawk\Auto_Jobs_Applier_AIHawk\virtualwindows\Lib\site-packages\lib_resume_builder_AIHawk\utils.py", line 14, in create_driver_selenium
    if platform.system() == "Windows":
       ^^^^^^^^
NameError: name 'platform' is not defined

Expected behavior

The resume should be generated and uploaded without errors.

Actual behavior

The resume generation fails due to the missing platform module, resulting in an exception and preventing the resume from being uploaded.

Branch

main

Branch name

No response

Python version

Python 3.11.3 and 3.10.12

LLM Used

ChatGPT

Model used

GPT-4o-Mini

Additional context

No response

distortment commented 3 weeks ago

Bump, same issue with same logs

nthomisee commented 3 weeks ago

Same issue and for me the code worked fine last week. checked and line 14 shows: if platform.system() == "Windows". If you add a line that says import platform to the top of the Lib\site-packages\lib_resume_builder_AIHawk\utils.py file it fixes it.

svangap1 commented 2 weeks ago

I don't see any lib folder in my directory, I am stuck here. (virtual) sandeepvangapandu@Mac Auto_Jobs_Applier_AIHawk % python main.py Traceback (most recent call last): File "/Users/sandeepvangapandu/Desktop/applications/Auto_Jobs_Applier_AIHawk/main.py", line 11, in <module> from lib_resume_builder_AIHawk import Resume, FacadeManager, ResumeGenerator, StyleManager ModuleNotFoundError: No module named 'lib_resume_builder_AIHawk'

Lib folder is not imported