07/06/2023, 1:46 PM
I have an install issue ๐Ÿ˜… In ๐Ÿงต
Copy code
(test-prefect) ellawherritt@MacBook-Pro prefect_workshop % python
Traceback (most recent call last):
  File "/Users/ellawherritt/github/prefect_workshop/", line 2, in <module>
    from prefect import flow
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/", line 37, in <module>
    from prefect.states import State
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/", line 14, in <module>
    from prefect.client.schemas import State as State
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/client/schemas/", line 4, in <module>
    from .actions import BlockTypeUpdate, StateCreate
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/client/schemas/", line 9, in <module>
    import prefect.client.schemas.objects as objects
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/client/schemas/", line 27, in <module>
    from prefect.utilities.templating import find_placeholders
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/utilities/", line 5, in <module>
    from prefect.client.utilities import inject_client
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/client/", line 9, in <module>
    from prefect.utilities.asyncutils import asyncnullcontext
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/utilities/", line 5, in <module>
    import ctypes
  File "/Users/ellawherritt/.pyenv/versions/3.11.1/lib/python3.11/ctypes/", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
I have tried using a different python version and installing a few different packages

Jeff Hale

07/06/2023, 1:47 PM
๐Ÿ™Œ 1
Looks like this is the cause - Iโ€™ve seen it on a few Python threads:
Copy code
I expect that the root cause is missing libffi(-dev[el]) on your system, preventing _ctypes from building, so your quick fix would be to install that and try again.
A different Python version might also work:


07/06/2023, 1:52 PM
I was on 3.7 awhile ago but had to switch to 3.11 to resolve this error. Had no issue with it until today ๐Ÿซ 
๐Ÿค” 1
Rejoice! I got it to work with 3.10. I'll take that as a win ๐Ÿ™‚ Thanks!
๐Ÿ™Œ 1
๐Ÿ‘ 1
๐Ÿ™ 1