python-shell
                                
                                 python-shell copied to clipboard
                                
                                    python-shell copied to clipboard
                            
                            
                            
                        Package import error when running electron app
I'm calling a python script as such:
let options = {
      scriptPath: bgScriptPath,
      args: ['process-data', '--site-id', site.id]
    }
let pyshell = new PythonShell(bgScriptPath, options, {mode: 'binery '})
This calls the python script correctly but this script has two module imports for two other python scripts I made. When it gets to these other scripts it fails importing modules they have, such as pandas or cv2.
I do have these installed, I am using pipenv for virtual enviroments and they are installed when running pipenv graph. When calling the three python scripts directly from terminal, they work fine, it just fails when calling them from the electron app using python-shell.
I wasn't sure if the scripts were weirdly being called outside of my virtual enviroment but replacing the scripts code with a simple output of "pipenv run pip freeze" shows a list of all the modules in my virtual enviroment including the ones it's saying it can't import.
The kicker is that this was working on my macbook, but it won't work on my Windows PC.
Same here!
Script with
import pandas
works with linux and python-shell. It also works in the python installation in windows, but hangs with python-shell in windows.
Did you find a solution? Any suggestion?
Any solution to this @mikecbone ?
Do the scripts work if you supply a pythonPath option? In my case a module was found when that was present, but not when it was absent.