You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dian Fu (Jira)" <ji...@apache.org> on 2023/04/26 14:42:00 UTC

[jira] [Comment Edited] (FLINK-28786) Cannot run PyFlink 1.16 on MacOS with M1 chip

    [ https://issues.apache.org/jira/browse/FLINK-28786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17716757#comment-17716757 ] 

Dian Fu edited comment on FLINK-28786 at 4/26/23 2:41 PM:
----------------------------------------------------------

Reopen it as one user reported an issue related to Mac M1 on 1.17.0 (https://apache-flink.slack.com/archives/C03G7LJTS2G/p1679904702297129):

{code}
Traceback (most recent call last):
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 287, in _execute
    response = task()
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 360, in <lambda>
    lambda: self.create_worker().do_instruction(request), request)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 597, in do_instruction
    getattr(request, request_type), request.instruction_id)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 634, in process_bundle
    bundle_processor.process_bundle(instruction_id))
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 1004, in process_bundle
    element.data)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 226, in process_encoded
    input_stream, True)
  File "apache_beam/coders/coder_impl.py", line 1519, in apache_beam.coders.coder_impl.ParamWindowedValueCoderImpl.decode_from_stream
  File "apache_beam/coders/coder_impl.py", line 1520, in apache_beam.coders.coder_impl.ParamWindowedValueCoderImpl.decode_from_stream
  File "apache_beam/coders/coder_impl.py", line 135, in apache_beam.coders.coder_impl.CoderImpl.decode_from_stream
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/pyflink/fn_execution/beam/beam_coder_impl_slow.py", line 34, in decode_from_stream
    return self._value_coder.decode_from_stream(in_stream, nested)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/pyflink/fn_execution/beam/beam_coder_impl_slow.py", line 58, in decode_from_stream
    return self._value_coder.decode_from_stream(data_input_stream)
TypeError: Argument 'input_stream' has incorrect type (expected pyflink.fn_execution.stream_fast.LengthPrefixInputStream, got BeamInputStream)
{code}


was (Author: dianfu):
Reopen it as one user reported an issue related to Mac M1 (https://apache-flink.slack.com/archives/C03G7LJTS2G/p1679904702297129):

{code}
Traceback (most recent call last):
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 287, in _execute
    response = task()
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 360, in <lambda>
    lambda: self.create_worker().do_instruction(request), request)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 597, in do_instruction
    getattr(request, request_type), request.instruction_id)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 634, in process_bundle
    bundle_processor.process_bundle(instruction_id))
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 1004, in process_bundle
    element.data)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 226, in process_encoded
    input_stream, True)
  File "apache_beam/coders/coder_impl.py", line 1519, in apache_beam.coders.coder_impl.ParamWindowedValueCoderImpl.decode_from_stream
  File "apache_beam/coders/coder_impl.py", line 1520, in apache_beam.coders.coder_impl.ParamWindowedValueCoderImpl.decode_from_stream
  File "apache_beam/coders/coder_impl.py", line 135, in apache_beam.coders.coder_impl.CoderImpl.decode_from_stream
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/pyflink/fn_execution/beam/beam_coder_impl_slow.py", line 34, in decode_from_stream
    return self._value_coder.decode_from_stream(in_stream, nested)
  File "/Users/dianfu/venv/examples-37/lib/python3.7/site-packages/pyflink/fn_execution/beam/beam_coder_impl_slow.py", line 58, in decode_from_stream
    return self._value_coder.decode_from_stream(data_input_stream)
TypeError: Argument 'input_stream' has incorrect type (expected pyflink.fn_execution.stream_fast.LengthPrefixInputStream, got BeamInputStream)
{code}

> Cannot run PyFlink 1.16 on MacOS with M1 chip
> ---------------------------------------------
>
>                 Key: FLINK-28786
>                 URL: https://issues.apache.org/jira/browse/FLINK-28786
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>    Affects Versions: 1.16.0
>            Reporter: Ran Tao
>            Assignee: Huang Xingbo
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.17.0, 1.16.2
>
>
> I have tested it with 2 m1 machines. i will reproduce the bug 100%.
> 1.m1 machine
> macos bigsur 11.5.1 & jdk8 * & jdk11 & python 3.8 & python 3.9
> 1.m1 machine
> macos monterey 12.1 & jdk8 * & jdk11 & python 3.8 & python 3.9
> reproduce step:
> 1.python -m pip install -r flink-python/dev/dev-requirements.txt
> 2.cd flink-python; python setup.py sdist bdist_wheel; cd apache-flink-libraries; python setup.py sdist; cd ..;
> 3.python -m pip install apache-flink-libraries/dist/*.tar.gz
> 4.python -m pip install dist/*.whl
> when run [word_count.py|https://nightlies.apache.org/flink/flink-docs-master/docs/dev/python/table_api_tutorial/] it will cause
> {code:java}
> <frozen importlib._bootstrap>:219: RuntimeWarning: apache_beam.coders.coder_impl.StreamCoderImpl size changed, may indicate binary incompatibility. Expected 24 from C header, got 32 from PyObject
> Traceback (most recent call last):
>   File "/Users/chucheng/GitLab/pyflink-demo/table/streaming/word_count.py", line 129, in <module>
>     word_count(known_args.input, known_args.output)
>   File "/Users/chucheng/GitLab/pyflink-demo/table/streaming/word_count.py", line 49, in word_count
>     t_env = TableEnvironment.create(EnvironmentSettings.in_streaming_mode())
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/table/table_environment.py", line 121, in create
>     return TableEnvironment(j_tenv)
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/table/table_environment.py", line 100, in __init__
>     self._open()
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/table/table_environment.py", line 1637, in _open
>     startup_loopback_server()
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/table/table_environment.py", line 1628, in startup_loopback_server
>     from pyflink.fn_execution.beam.beam_worker_pool_service import \
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/fn_execution/beam/beam_worker_pool_service.py", line 44, in <module>
>     from pyflink.fn_execution.beam import beam_sdk_worker_main  # noqa # pylint: disable=unused-import
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/fn_execution/beam/beam_sdk_worker_main.py", line 21, in <module>
>     import pyflink.fn_execution.beam.beam_operations # noqa # pylint: disable=unused-import
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/fn_execution/beam/beam_operations.py", line 27, in <module>
>     from pyflink.fn_execution.state_impl import RemoteKeyedStateBackend, RemoteOperatorStateBackend
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/fn_execution/state_impl.py", line 33, in <module>
>     from pyflink.fn_execution.beam.beam_coders import FlinkCoder
>   File "/Users/chucheng/venv/lib/python3.8/site-packages/pyflink/fn_execution/beam/beam_coders.py", line 27, in <module>
>     from pyflink.fn_execution.beam import beam_coder_impl_fast as beam_coder_impl
>   File "pyflink/fn_execution/beam/beam_coder_impl_fast.pyx", line 1, in init pyflink.fn_execution.beam.beam_coder_impl_fast
> KeyError: '__pyx_vtable__'
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)