question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'eel' has no attribute 'updateTasks'

See original GitHub issue

Describe the problem I call an exposed python function “load_data_object”, and it run fine until the row where I try to call a JS function, “updateTasks” throwing the following error:

Traceback (most recent call last):
  File "src\gevent\greenlet.py", line 766, in gevent._greenlet.Greenlet.run
  File "C:\Users\*******\AppData\Local\Programs\Python\Python36-32\lib\site-packages\eel\__init__.py", line 257, in _process_message
    return_val = _exposed_functions[message['name']](*message['args'])
  File "index.py", line 58, in load_data_object
    eel.updateTasks({"task_load_data_object": 1})
AttributeError: module 'eel' has no attribute 'updateTasks'
2020-03-28T14:42:40Z <Greenlet at 0xf9ff7a0: _process_message({'call': 1.0315686370569765, 'name': 'load_data_ob, <geventwebsocket.websocket.WebSocket object at 0x0)> failed with Att
ributeError

Code snippet(s)

index.py

import eel
...
@eel.expose()
def load_data_object():
    directories = read_data_directory()
    data = []
    for directory in directories:
        reader_images = list(csv_read(f"data/{directory}/images.csv", delimiter=";"))
        reader_owners = list(csv_read(f"data/{directory}/owners.csv", delimiter=";"))
        reader_extra = list(csv_read(f"data/{directory}/extra.csv", delimiter=";"))
        obj = {
            "images": reader_images,
            "owners": reader_owners,
            "extra": reader_extra
        }
        data.append({directory: obj})

    print("updatetasks")
    eel.updateTasks({"task_load_data_object": 1})

    return data

...

eel.js

import {store} from "./redux/store";
import {update_tasks} from "./redux/actions";

export const eel = window.eel;

eel.expose(updateTasks)
function updateTasks(data){
    alert(data)
    store.dispatch(update_tasks(data))
}

index.js

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import {Provider} from 'react-redux'
import {store} from './redux/store'
import {eel} from './eel'

import 'normalize.css/normalize.css'
import '@blueprintjs/core/lib/css/blueprint.css'
import '@blueprintjs/icons/lib/css/blueprint-icons.css'
import '@blueprintjs/datetime/lib/css/blueprint-datetime.css'
import 'antd/dist/antd.css'
import './index.css' 

eel.set_host('ws://localhost:8888') // development

ReactDOM.render(
    <Provider store={store}>
        <App/>
    </Provider>,
    document.getElementById('root')
)

Desktop:

  • OS: Windows 10 1909
  • Browser: Chrome 80.0.3987.149
  • Eel: 0.12.2
  • Python: 3.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
RahulBadenkalcommented, Mar 29, 2020

Hi, Dont understand react much, but can you rename your js file to something other than eel.js (as eel library already uses a js file called eel.js). That might be causing the issue but I am not sure.

1reaction
pearcetmcommented, Apr 2, 2020

Is your eel.js file ever actually included? The './eel' import is the package-provided javascript function. Depending on your directory structure you may need to include it separately (as just 'eel.js'?) or by renaming it as @RahulBadenkal suggested above so it doesn’t conflict with the file that is autogenerated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'eel' has no attribute 'updateTasks' #263
Describe the problem I call an exposed python function "load_data_object", and it run fine until the row where I try to call a...
Read more >
auto-py-to-exe problem with "module 'eel.chrome'"
I want to convert my script to an exe but after installing auto-py-to-exe with -pip ...
Read more >
[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >
How to Resolve Module Has No Attribute - Python Error ...
In this tutorial I will be showing you how to MANAGE THE " MODULE HAS NO ATTRIBUTE" ERROR MESSAGE using Python. This is...
Read more >
'module' object has no attribute in 3minutes - YouTube
" AttributeError : object has no attribute "Understand how to trouble shoot the error message. Examples used in the video:When you append a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found