PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
17.68k stars 1.65k forks source link

Error importing prefect on Windows 10 #10104

Closed rodrigomartinez1302 closed 1 year ago

rodrigomartinez1302 commented 1 year ago

First check

Bug summary

Hi everyone, this is my first bug report. I asked for the error on Slack channel and they suggested me to open a bug report.

The error refers to the import of prefect on windows 10.

windows info

Reproduction

import prefect

Error

runfile('C:/Users/rmartinezg/untitled0.py', wdir='C:/Users/rmartinezg')
Traceback (most recent call last):

  File ~\untitled0.py:8 in <module>
    import prefect

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\__init__.py:37 in <module>
    from prefect.states import State

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\states.py:14 in <module>
    from prefect.client.schemas import State as State

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\client\schemas\__init__.py:4 in <module>
    from .actions import BlockTypeUpdate, StateCreate

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\client\schemas\actions.py:9 in <module>
    import prefect.client.schemas.objects as objects

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\client\schemas\objects.py:20 in <module>
    from prefect._internal.schemas.bases import ObjectBaseModel, PrefectBaseModel

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\_internal\schemas\bases.py:18 in <module>
    from prefect._internal.compatibility.experimental import experiment_enabled

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\_internal\compatibility\experimental.py:19 in <module>
    from prefect.settings import PREFECT_EXPERIMENTAL_WARN, SETTING_VARIABLES, Setting

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\settings.py:70 in <module>
    from prefect._internal.compatibility.deprecated import generate_deprecation_message

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\_internal\compatibility\deprecated.py:21 in <module>
    from prefect.utilities.importtools import (

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\utilities\importtools.py:17 in <module>
    from prefect.utilities.filesystem import filename, is_local_path, tmpchdir

  File ~\AppData\Roaming\Python\Python39\site-packages\prefect\utilities\filesystem.py:5 in <module>
    import resource

ModuleNotFoundError: No module named 'resource'

Versions

Name: prefect
Version: 2.10.17
Summary: Workflow orchestration and management.
Home-page: https://www.prefect.io
Author: Prefect Technologies, Inc.
Author-email: help@prefect.io
License:
Location: c:\users\rmartinezg\appdata\roaming\python\python39\site-packages
Requires: aiosqlite, alembic, anyio, apprise, asgi-lifespan, asyncpg, click, cloudpickle, coolname, croniter, cryptography, dateparser, docker, fastapi, fsspec, griffe, httpx, importlib-metadata, jinja2, jsonpatch, jsonschema, kubernetes, orjson, packaging, pathspec, pendulum, pydantic, python-slugify, pytz, pyyaml, readchar, rich, ruamel-yaml, sqlalchemy, toml, typer, typing-extensions, uvicorn, websockets
Required-by:

Python 3.9.12

Additional context

Manyt thanks

billpalombi commented 1 year ago

Thank you for filing this issue @rodrigomartinez1302!

A quick search suggests that the way that we are packaging prefect may be specific to unix. We should explore what we can do to prevent this error on Windows.

billpalombi commented 1 year ago

Ah, I see this was also reported in #10107. @jawnsy says that there is a fix on its way.

jawnsy commented 1 year ago

Closing this issue as it appears to be a duplicate of #10107, which I believe was resolved. Please comment if you are still having issues and we'll help troubleshoot.