• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

594
Views
Uncaught ReferenceError: require is not defined and Uncaught ReferenceError: Cannot access 'PythonShell' before initialization at electron

This is an electron app and I am trying to execute one python file that just prints "hello world through javascript. I am getting two errors: error 1: main.js:1 Uncaught ReferenceError: require is not defined

error 2: Uncaught ReferenceError: Cannot access 'PythonShell' before initialization

this is the javascript code:

let {PythonShell} = require('python-shell');

function exec_py(){
    console.log("am in");
    PythonShell.run("main_script.py", null, function(err,result){
    console.log(result)
})

}
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error