https://prefect.io logo
e

Ella

07/06/2023, 1:46 PM
I have an install issue ๐Ÿ˜… In ๐Ÿงต
Copy code
(test-prefect) ellawherritt@MacBook-Pro prefect_workshop % python flowtest.py
Traceback (most recent call last):
  File "/Users/ellawherritt/github/prefect_workshop/flowtest.py", line 2, in <module>
    from prefect import flow
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/__init__.py", line 37, in <module>
    from prefect.states import State
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/states.py", 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/__init__.py", line 4, in <module>
    from .actions import BlockTypeUpdate, StateCreate
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/client/schemas/actions.py", 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/objects.py", 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/templating.py", 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/utilities.py", line 9, in <module>
    from prefect.utilities.asyncutils import asyncnullcontext
  File "/Users/ellawherritt/.pyenv/versions/test-prefect/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 5, in <module>
    import ctypes
  File "/Users/ellawherritt/.pyenv/versions/3.11.1/lib/python3.11/ctypes/__init__.py", 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
j

Jeff Hale

07/06/2023, 1:47 PM
Looking.
๐Ÿ™Œ 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: https://github.com/pypa/pipenv/issues/4901
e

Ella

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
3 Views