Search code examples
pythonwindowspipresourcesprefect

Why is "pip install prefect" downloading different versions of Prefect on different computers


When running a prefect python (3.11) script on a Windows OS, I am getting the error:

lib\site-packages\prefect\utilities\filesystem.py", line 5, in <module>
    import resource
ModuleNotFoundError: No module named 'resource'

The function that uses the resource package in the filesystem.py file in the Prefect library is as follows, and there doesn't seem to be a way of deleting it safely:

def get_open_file_limit():
    soft_limit, _ = resource.getrlimit(resource.RLIMIT_NOFILE)
    return soft_limit

When my friend runs 'pip install Prefect' he is getting a Prefect version that does not include this resource library.

Note that the "Resource Module' is native to Linux, and attempts to pip install various versions of python-resources doesn't resolve the issue.

I also checked the Prefect Github page, and there is no sign of this resource module being included in the respective filesytem.py file.

I've reinstalled both Python and Prefect various times with different versions to no avail. Does anyone know what I am getting this issue?


Solution

  • The bug was reported and fixed a few days ago: https://github.com/PrefectHQ/prefect/issues/10054

    The solution for now: avoid installing version 2.10.17, it's buggy:

    pip install "prefect!=2.10.17"