WindmillWWindmill
Powered by
YizheY
Windmill•16mo ago•
7 replies
Yizhe

Python import randomly fails

Here's my script:

# requirements:
# psd_tools

from psd_tools import PSDImage

def main():
    return None
# requirements:
# psd_tools

from psd_tools import PSDImage

def main():
    return None


When I execute it, about 60% of the time it fails with the following error messages:

ExecutionErr: ExitCode: 1, last log lines:
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/tmp/windmill/wk-default-f609a61209f6-TbLO9/01932967-f3dc-c0f3-6009-2402dacd47c8/wrapper.py", line 10, in <module>
    from u.sunyizhe import tougher_script as inner_script
  File "/tmp/windmill/wk-default-f609a61209f6-TbLO9/01932967-f3dc-c0f3-6009-2402dacd47c8/u/sunyizhe/tougher_script.py", line 4, in <module>
    from psd_tools import PSDImage
ImportError: cannot import name 'PSDImage' from 'psd_tools' (unknown location)
ExecutionErr: ExitCode: 1, last log lines:
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/tmp/windmill/wk-default-f609a61209f6-TbLO9/01932967-f3dc-c0f3-6009-2402dacd47c8/wrapper.py", line 10, in <module>
    from u.sunyizhe import tougher_script as inner_script
  File "/tmp/windmill/wk-default-f609a61209f6-TbLO9/01932967-f3dc-c0f3-6009-2402dacd47c8/u/sunyizhe/tougher_script.py", line 4, in <module>
    from psd_tools import PSDImage
ImportError: cannot import name 'PSDImage' from 'psd_tools' (unknown location)


Tweaking
#requirement psd_tools
#requirement psd_tools
doesn't help. Other dependencies don't work as well. I cannot reproduce it reliably.
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Python Import Error
SpookyBiscuit40SSpookyBiscuit40 / help
15mo ago
Failed to import Python Libaries
LeandroLLeandro / help
15mo ago
Python Import Issue - Haystack library overriden
developerDdeveloper / help
2y ago
Trying to import Python package but Windmill doesn't recognise it
SharmikaNCFCSSharmikaNCFC / help
16mo ago