securefederatedai / openfl

An Open Framework for Federated Learning.
https://openfl.readthedocs.io/en/latest/index.html
Apache License 2.0
721 stars 201 forks source link

OpenFL fails to run on Ubuntu 20.04 #540

Open DL8 opened 2 years ago

DL8 commented 2 years ago

Describe the bug

OpenFL execution (fx command) fails to run with exception in Ubuntu 20.04. This happens when installing OpenFL via pip in a clean virtual environment.

This seems to be worked around by installing an older version of protobuf: pip install 'protobuf<3.20'

To Reproduce

python -m venv venv
cd venv
source bin/activate
pip install openfl
fx

Expected behavior

fx prints usage details

Screenshots Error messages during pip install: image

Error when invoking fx command: image

mansishr commented 1 year ago

Hi @DL8, could you check if pip install openfl --upgrade pip works? Sometimes, an older version of pip causes issues like these.

DL8 commented 1 year ago

It didn't work. Note that this problem happens only when installing from Pip repos. It doesn't happen when building latest version in develop branch

avinsit123 commented 1 year ago

I am facing the same issue while running OpenFL on Google Colab( Ubuntu 20.04 LTS). Is there any way to resolve this issue apart from changing the OS?

tanwarsh commented 1 week ago

Hi @DL8, I was able to reproduce the issue for Ububtu 20.04.6

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"

can you please try running export PYTHONIOENCODING=utf-8 before running fx command


(openfl) xxxx:~/shailesh/openfl$ fx
OpenFL - Open Federated Learning                                                

EXCEPTION : 'latin-1' codec can't encode characters in position 595-674: ordinal not in range(256)
Traceback (most recent call last):
  File "/home/perfuser/shailesh/openfl/openfl/bin/fx", line 8, in <module>
    sys.exit(entry())
             ^^^^^^^
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/openfl/interface/cli.py", line 327, in entry
    error_handler(e)
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/openfl/interface/cli.py", line 246, in error_handler
    raise error
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/openfl/interface/cli.py", line 325, in entry
    cli(max_content_width=120)
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/click/core.py", line 1077, in main
    with self.make_context(prog_name, args, **extra) as ctx:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/click/core.py", line 943, in make_context
    self.parse_args(ctx, args)
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/click/core.py", line 1641, in parse_args
    echo(ctx.get_help(), color=ctx.color)
  File "/home/perfuser/shailesh/openfl/openfl/lib/python3.11/site-packages/click/utils.py", line 318, in echo
    file.write(out)  # type: ignore
    ^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 595-674: ordinal not in range(256)
(openfl) xxxx:~/shailesh/openfl$ export PYTHONIOENCODING=utf-8
(openfl) xxxx:~/shailesh/openfl$ fx
OpenFL - Open Federated Learning                                                

BASH COMPLETE ACTIVATION

Run in terminal:
   _FX_COMPLETE=bash_source fx > ~/.fx-autocomplete.sh
   source ~/.fx-autocomplete.sh
If ~/.fx-autocomplete.sh has already exist:
   source ~/.fx-autocomplete.sh

CORRECT USAGE

fx [options] [command] [subcommand] [args]

GLOBAL OPTIONS

-l, --log-level TEXT  Logging verbosity level.
--no-warnings         Disable third-party warnings.
--help                Show this message and exit.```
tanwarsh commented 1 week ago

@avinsit123 Can you please provide steps to reproduce this issue?

I am facing the same issue while running OpenFL on Google Colab( Ubuntu 20.04 LTS). Is there any way to resolve this issue apart from changing the OS?

tanwarsh commented 1 week ago

Hi @DL8 and @avinsit123,

Please let us know if you are still experiencing this issue. If we do not hear back within a week, we will close this issue. You can create a new issue or reopen this one if the problem persists.