You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Kenneth Shine <ke...@broadcom.com> on 2022/06/01 19:53:36 UTC

Help installing apache-flink and numpy to run flink python examples

I am using MacOS Monterey 12.3.1

I have download flink source and examples from GitHub

I have installed python 3.10.4 from https://www.python.org/downloads/macos/

In flink/libexec/examples/python/datastream, I run



/usr/local/bin/python3 word_count.py

But get error



Traceback (most recent call last):

  File "
/usr/local/Cellar/apache-flink/1.15.0/libexec/examples/python/datastream/word_count.py",
line 22, in <module>

    from pyflink.common import WatermarkStrategy, Encoder, Types

ModuleNotFoundError: No module named 'pyflink'



To install pyflink, I run

/usr/local/bin/python3 -m pip install apache-flink

But get error

      × Encountered error while trying to install package.

      ╰─> numpy



So I install numpy

/usr/local/bin/python3 -m pip install numpy

Which is successful.



Yet when I attempt to install pyflink now

/usr/local/bin/python3 -m pip install apache-flink

I get the same error regarding numpy.

How can I get around this error?



 The error messages from installing pyFlink are quite long.  I have
attached more of the end of the error message.


Thank you for any help you can give me.

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

Re: Help installing apache-flink and numpy to run flink python examples

Posted by Xingbo Huang <hx...@gmail.com>.
Hi Kenneth,

In flink 1.15, pyflink only guarantees support for python 3.6,3.7 and
3.8[1]. In release-1.16, pyflink will provide support for python 3.9[2].

Go back to your installation error. In flink 1.15, the version range of
numpy that pyflink depends on is numpy>=1.14.3,<1.20. So when you execute
`pip install apache-flink`, the version of numpy trying to install is
1.19.5. However, numpy 1.19.5 does not provide the wheel package for python
3.10[3]. Therefore, numpy 1.19.5 will be installed from source code, which
is often difficult to install successfully. For details, you can refer to
the source code installation of numpy[4]. The reason why you successfully
executed `pip install numpy` is that the latest 1.22.4 version of numpy is
installed by default, which provides the wheel package of python 3.10[5].

From my point of view, your current option solution is to install a python
3.8 virtual environment with conda, and then install Pyflink.

Best,
Xingbo

[1]
https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/dev/python/installation/#environment-requirements
[2] https://issues.apache.org/jira/browse/FLINK-27058
[3] https://pypi.org/project/numpy/1.19.5/#files
[4] https://numpy.org/doc/stable/user/building.html
[5] https://pypi.org/project/numpy/1.22.4/#files

Xuyang <xy...@163.com> 于2022年6月2日周四 10:34写道:

> Hi, Kenneth, have you tried the setup file[1] in the Flink-Python? It
> maybe can work.
>
> [1] https://github.com/apache/flink/blob/master/flink-python/setup.py
>
> At 2022-06-02 03:53:36, "Kenneth Shine" <ke...@broadcom.com>
> wrote:
>
> I am using MacOS Monterey 12.3.1
>
> I have download flink source and examples from GitHub
>
> I have installed python 3.10.4 from
> https://www.python.org/downloads/macos/
>
> In flink/libexec/examples/python/datastream, I run
>
>
>
> /usr/local/bin/python3 word_count.py
>
> But get error
>
>
>
> Traceback (most recent call last):
>
>   File "
> /usr/local/Cellar/apache-flink/1.15.0/libexec/examples/python/datastream/word_count.py",
> line 22, in <module>
>
>     from pyflink.common import WatermarkStrategy, Encoder, Types
>
> ModuleNotFoundError: No module named 'pyflink'
>
>
>
> To install pyflink, I run
>
> /usr/local/bin/python3 -m pip install apache-flink
>
> But get error
>
>       × Encountered error while trying to install package.
>
>       ╰─> numpy
>
>
>
> So I install numpy
>
> /usr/local/bin/python3 -m pip install numpy
>
> Which is successful.
>
>
>
> Yet when I attempt to install pyflink now
>
> /usr/local/bin/python3 -m pip install apache-flink
>
> I get the same error regarding numpy.
>
> How can I get around this error?
>
>
>
>  The error messages from installing pyFlink are quite long.  I have
> attached more of the end of the error message.
>
>
> Thank you for any help you can give me.
>
>
>
> This electronic communication and the information and any files
> transmitted with it, or attached to it, are confidential and are intended
> solely for the use of the individual or entity to whom it is addressed and
> may contain information that is confidential, legally privileged, protected
> by privacy laws, or otherwise restricted from disclosure to anyone else. If
> you are not the intended recipient or the person responsible for delivering
> the e-mail to the intended recipient, you are hereby notified that any use,
> copying, distributing, dissemination, forwarding, printing, or copying of
> this e-mail is strictly prohibited. If you received this e-mail in error,
> please return the e-mail to the sender, delete it from your computer, and
> destroy any printed copy of it.
>
>

Re:Help installing apache-flink and numpy to run flink python examples

Posted by Xuyang <xy...@163.com>.
Hi, Kenneth, have you tried the setup file[1] in the Flink-Python? It maybe can work.

[1] https://github.com/apache/flink/blob/master/flink-python/setup.py



At 2022-06-02 03:53:36, "Kenneth Shine" <ke...@broadcom.com> wrote:

I am using MacOS Monterey 12.3.1


I have download flink source and examples from GitHub

I have installed python 3.10.4 from https://www.python.org/downloads/macos/

In flink/libexec/examples/python/datastream, I run

 

/usr/local/bin/python3 word_count.py

But get error

 

Traceback (most recent call last):

  File "/usr/local/Cellar/apache-flink/1.15.0/libexec/examples/python/datastream/word_count.py", line 22, in <module>

    from pyflink.common import WatermarkStrategy, Encoder, Types

ModuleNotFoundError: No module named 'pyflink'

 

To install pyflink, I run

/usr/local/bin/python3 -m pip install apache-flink

But get error 

      × Encountered error while trying to install package.

      ╰─> numpy

 

So I install numpy

/usr/local/bin/python3 -m pip install numpy

Which is successful.

 

Yet when I attempt to install pyflink now

/usr/local/bin/python3 -m pip install apache-flink

I get the same error regarding numpy.

How can I get around this error?

 

 The error messages from installing pyFlink are quite long.  I have attached more of the end of the error message.




Thank you for any help you can give me.

 


This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.