I am trying the example present in documentation. ...
# announcements
r
I am trying the example present in documentation. Getting the following error
Copy code
(flyte)  raviraja@ip-192-168-124-8  ~/Desktop/flows/flyte_flows    pyflyte run example.py:wf --n 500 --mean 42 --sigma 2

Usage: pyflyte [OPTIONS] COMMAND [ARGS]...
Try 'pyflyte --help' for help.

Error: No such command 'run'.
Copy code
(flyte)  raviraja@ip-192-168-124-8  ~/Desktop/flows/flyte_flows    pyflyte --help
Usage: pyflyte [OPTIONS] COMMAND [ARGS]...

  Entrypoint for all the user commands.

Options:
  -c, --config TEXT       Path to config file for use within container
  -k, --pkgs TEXT         Dot separated python packages to operate on.
                          Multiple may be specified  Please note that this
                          option will override the option specified in the
                          configuration file, or environment variable
  -i, --insecure BOOLEAN  Disable SSL when connecting to Flyte backend.
  --help                  Show this message and exit.

Commands:
  init         Create flyte-ready projects.
  local-cache  Interact with the local cache.
  package      This command produces a Flyte backend registrable package...
  serialize    This command produces protobufs for tasks and templates.
run
is not available. Am I missing something? When running normally with
python example.py
it is working fine. I have installed
flytekit==0.32.6
this version.
g
I just checked my install, and
run
appears to be there! Check
pip freeze
?
y
yeah can you
pip show flytekit
?
that’s very weird
r
Copy code
(flyte)  ✘ raviraja@ip-192-168-124-8  ~/Desktop/python-monorepo/taxonomy/taxonomy/flows/flyte_flows    pip show flytekit
Name: flytekit
Version: 0.32.6
Summary: Flyte SDK for Python
Home-page: <https://github.com/flyteorg/flytekit>
Author:
Author-email:
License: apache2
Location: /opt/miniconda3/envs/flyte/lib/python3.8/site-packages
Requires: checksumdir, click, cloudpickle, cookiecutter, croniter, dataclasses-json, deprecated, diskcache, docker-image-py, docstring-parser, flyteidl, grpcio, grpcio-status, keyring, marshmallow-jsonschema, natsort, pandas, protobuf, pyarrow, python-dateutil, python-json-logger, pytimeparse, pytz, pyyaml, requests, responses, retry, sortedcontainers, statsd, typing-extensions, urllib3, wheel, wrapt
Required-by:
Can you install once using pip instead of local repo
@Greg Gydush @Yee any leads?
g
Interesting - I installed with
poetry
which uses
pip
but can try in a fresh container
👍 1
Hmmm interesting. can you do
which pyflyte
- oddly, when I installed with
pip
I don’t get a pyflyte command 🙃
Copy code
dev@17546bca2a64:/usr/src/app$ pip show flytekit
Name: flytekit
Version: 0.32.6
Summary: Flyte SDK for Python
Home-page: <https://github.com/flyteorg/flytekit>
Author: 
Author-email: 
License: apache2
Location: /home/dev/.local/lib/python3.9/site-packages
Requires: pyarrow, natsort, diskcache, keyring, dataclasses-json, typing-extensions, cookiecutter, pytimeparse, croniter, responses, flyteidl, docstring-parser, cloudpickle, pyyaml, statsd, wheel, python-json-logger, requests, pytz, deprecated, python-dateutil, sortedcontainers, checksumdir, urllib3, pandas, click, docker-image-py, grpcio-status, protobuf, wrapt, grpcio, marshmallow-jsonschema, retry
Required-by: 
dev@17546bca2a64:/usr/src/app$ pyflyte --help
bash: pyflyte: command not found
y
can you
which python
also can you
ipython
and then
import flytekit; flytekit.__file__
g
I’m in a container.
Copy code
dev@17546bca2a64:/usr/src/app$ which python
/fn/bin/python
dev@17546bca2a64:/usr/src/app$ python
Python 3.9.10 (main, Apr  7 2022, 15:43:32) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flytekit
>>> flytekit.__file__
'/home/dev/.local/lib/python3.9/site-packages/flytekit/__init__.py'
Run is there 🤦 - the above error was my bad (.local not in $PATH)
Copy code
dev@17546bca2a64:/usr/src/app$ /home/dev/.local/bin/pyflyte --help
Usage: pyflyte [OPTIONS] COMMAND [ARGS]...

  Entrypoint for all the user commands.

Options:
  -k, --pkgs TEXT    Dot separated python packages to operate on.  Multiple
                     may be specified  Please note that this option will
                     override the option specified in the configuration file,
                     or environment variable
  -c, --config TEXT  Path to config file for use within container
  --help             Show this message and exit.

Commands:
  init         Create flyte-ready projects.
  local-cache  Interact with the local cache.
  package      This command produces a Flyte backend registrable package...
  run          Run command, a.k.a.
  serialize    This command produces protobufs for tasks and templates.
r
I am using conda virtualenv.. does that make a problem?
g
It shouldn’t - do
which pyflyte
and
which python
tho - I’m curious where it’s installed
r
message has been deleted
Resolved it. I tried uninstalling and then installing with
--no-cache-dir
option in pip. Then it worked
🎉 1
170 Views