David
David

Reputation: 113

pyflink, ImportError: No module named pyflink

I am testing pyflink on

pip list:

I tried to run this command :

Caused by: java.io.IOException: Failed to execute the command: python -c import pyflink;import os;print(os.path.join(os.path.abspath(os.path.dirname(pyflink.file)), 'bin')) output: Traceback (most recent call last): File "", line 1, in ImportError: No module named pyflink

I am sure pyflink package is already installed. Does anyone know why?

Upvotes: 1

Views: 4582

Answers (2)

Zak_Stack
Zak_Stack

Reputation: 137

You have to check if pyflink is well installed (in your venv)

also check if you are running Flink

if no, start it with :

start-cluster.sh

here is full documentation about PyFlink: https://nightlies.apache.org/flink/flink-docs-master/docs/dev/python/overview/

Upvotes: 0

ChangLi
ChangLi

Reputation: 813

To install PyFlink, you only need to execute:

python -m pip install apache-flink

and make sure you have a compatible Python version (>= 3.5).

The problem may be the Python Virtual Environment, refer to https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/python/faq/#preparing-python-virtual-environment

Also may be you can add option '-pyexec venv.zip/venv/bin/python3' and have a try

Upvotes: 3

Related Questions