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.

Error when running example: AttributeError: 'module' object has no attribute '__file__'

See original GitHub issue

I’m testing toil on python 2.7.6, and it bugs out after this line:

  from toil.job import Job

  def helloWorld(message, memory="2G", cores=2, disk="3G"):
      return "Hello, world!, here's a message: %s" % message

  j = Job.wrapFn(helloWorld, "woot")

Error seems to be getting the file attribute from the module:

  >>> j = Job.wrapFn(helloWorld, "woot")
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/vanessa/.local/lib/python2.7/site-packages/toil/job.py", line 280, in wrapFn
     return FunctionWrappingJob(fn, *args, **kwargs)
     File "/home/vanessa/.local/lib/python2.7/site-packages/toil/job.py", line 2678, in __init__
     self.userFunctionModule = ModuleDescriptor.forModule(userFunction.__module__).globalize()
     File "/home/vanessa/.local/lib/python2.7/site-packages/toil/resource.py", line 363, in forModule
     filePath = os.path.abspath(module.__file__)
     AttributeError: 'module' object has no attribute '__file__'

This is toil toil-3.2.1, python 2.7.6, on ubuntu. It produces the same error whether I do a local install with --user, or install to system with sudo. Is the example up to date with the current version?

┆Issue is synchronized with this Jira Story ┆Issue Number: TOIL-88

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
vsochcommented, Apr 15, 2020

lol! Well when I opened this issue in 2016 you most definitely did 😃 Thanks for the err, speedy response?

0reactions
DailyDreamingcommented, Apr 15, 2020

We no longer run python2.7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'module' object has no attribute 'file'' when using oauth2client ...
In original sample. https://developers.google.com/google-apps/calendar/quickstart/python#step_3_set_up_the_sample. missing import entry:
Read more >
AttributeError: 'module' object has no attribute 'main'
Module object has no attribute error : Python. An attribute in Python means some property that is associated with a particular type of...
Read more >
[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >
AttributeError: 'module' object has no attribute 'root'
Do you know what version of python you're running? You can check with “python --version”. Dedalus requires Python 3, which is normally invoked...
Read more >
Error AttributeError module object has no attribute tests
To validate your test case just try import the test case file in python console. Example: from project.apps.app1.tests import *. Hope it helps!!...
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