f5devcentral / f5-cli

F5 CLI
Apache License 2.0
12 stars 1 forks source link

module 'f5cli.utils' has no attribute 'core' #7

Open codygreen opened 4 years ago

codygreen commented 4 years ago

Error reproducible in Ubuntu 18.04 using Python3 with and without virtual environments. This is a lab inside the F5 Unified Demo Framework (UDF) so I can provide access if needed.

(sdk-env) ubuntu@ip-10-1-1-7:~$ f5 login --authentication-provider bigip --host 10.1.1.4 --user admin
Traceback (most recent call last):
  File "/home/ubuntu/sdk-env/bin/f5", line 7, in <module>
    from f5cli.cli import cli
  File "/home/ubuntu/sdk-env/lib/python3.6/site-packages/f5cli/cli.py", line 10, in <module>
    from f5cli.utils.core import format_output
  File "/home/ubuntu/sdk-env/lib/python3.6/site-packages/f5cli/utils/core.py", line 10, in <module>
    from f5cli.config import ConfigurationClient
  File "/home/ubuntu/sdk-env/lib/python3.6/site-packages/f5cli/config/__init__.py", line 3, in <module>
    from .core import ConfigurationClient
  File "/home/ubuntu/sdk-env/lib/python3.6/site-packages/f5cli/config/core.py", line 8, in <module>
    import f5cli.utils.core as utils
AttributeError: module 'f5cli.utils' has no attribute 'core'
(sdk-env) ubuntu@ip-10-1-1-7:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
(sdk-env) ubuntu@ip-10-1-1-7:~$ python -v
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# /usr/lib/python3.6/encodings/__pycache__/__init__.cpython-36.pyc matches /usr/lib/python3.6/encodings/__init__.py
# code object from '/usr/lib/python3.6/encodings/__pycache__/__init__.cpython-36.pyc'
# /usr/lib/python3.6/__pycache__/codecs.cpython-36.pyc matches /usr/lib/python3.6/codecs.py
# code object from '/usr/lib/python3.6/__pycache__/codecs.cpython-36.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3843c8>
# /usr/lib/python3.6/encodings/__pycache__/aliases.cpython-36.pyc matches /usr/lib/python3.6/encodings/aliases.py
# code object from '/usr/lib/python3.6/encodings/__pycache__/aliases.cpython-36.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c391d68>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3f5ef0>
# /usr/lib/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc matches /usr/lib/python3.6/encodings/utf_8.py
# code object from '/usr/lib/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c39fb70>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc matches /usr/lib/python3.6/encodings/latin_1.py
# code object from '/usr/lib/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3a76a0>
# /usr/lib/python3.6/__pycache__/io.cpython-36.pyc matches /usr/lib/python3.6/io.py
# code object from '/usr/lib/python3.6/__pycache__/io.cpython-36.pyc'
# /usr/lib/python3.6/__pycache__/abc.cpython-36.pyc matches /usr/lib/python3.6/abc.py
# code object from '/usr/lib/python3.6/__pycache__/abc.cpython-36.pyc'
# /usr/lib/python3.6/__pycache__/_weakrefset.cpython-36.pyc matches /usr/lib/python3.6/_weakrefset.py
# code object from '/usr/lib/python3.6/__pycache__/_weakrefset.cpython-36.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3ab630>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3a7c88>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3a78d0>
# /usr/lib/python3.6/__pycache__/site.cpython-36.pyc matches /usr/lib/python3.6/site.py
# code object from '/usr/lib/python3.6/__pycache__/site.cpython-36.pyc'
# /usr/lib/python3.6/__pycache__/os.cpython-36.pyc matches /usr/lib/python3.6/os.py
# code object from '/usr/lib/python3.6/__pycache__/os.cpython-36.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.6/__pycache__/stat.cpython-36.pyc matches /usr/lib/python3.6/stat.py
# code object from '/usr/lib/python3.6/__pycache__/stat.cpython-36.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c34e9e8>
# /usr/lib/python3.6/__pycache__/posixpath.cpython-36.pyc matches /usr/lib/python3.6/posixpath.py
# code object from '/usr/lib/python3.6/__pycache__/posixpath.cpython-36.pyc'
# /usr/lib/python3.6/__pycache__/genericpath.cpython-36.pyc matches /usr/lib/python3.6/genericpath.py
# code object from '/usr/lib/python3.6/__pycache__/genericpath.cpython-36.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c359400>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3540f0>
# /usr/lib/python3.6/__pycache__/_collections_abc.cpython-36.pyc matches /usr/lib/python3.6/_collections_abc.py
# code object from '/usr/lib/python3.6/__pycache__/_collections_abc.cpython-36.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c359a58>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c341320>
# /usr/lib/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc matches /usr/lib/python3.6/_sitebuiltins.py
# code object from '/usr/lib/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c341710>
# /usr/lib/python3.6/__pycache__/sysconfig.cpython-36.pyc matches /usr/lib/python3.6/sysconfig.py
# code object from '/usr/lib/python3.6/__pycache__/sysconfig.cpython-36.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c2e6e48>
# /usr/lib/python3.6/__pycache__/_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc matches /usr/lib/python3.6/_sysconfigdata_m_linux_x86_64-linux-gnu.py
# code object from '/usr/lib/python3.6/__pycache__/_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc'
import '_sysconfigdata_m_linux_x86_64-linux-gnu' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c2ff748>
# /usr/lib/python3.6/__pycache__/sitecustomize.cpython-36.pyc matches /usr/lib/python3.6/sitecustomize.py
# code object from '/usr/lib/python3.6/__pycache__/sitecustomize.cpython-36.pyc'
import 'sitecustomize' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c30d7b8>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c3b1f60>
Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/usr/lib/python3.6/lib-dynload/readline.cpython-36m-x86_64-linux-gnu.so'
# extension module 'readline' executed from '/usr/lib/python3.6/lib-dynload/readline.cpython-36m-x86_64-linux-gnu.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fe24c30dda0>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.6/__pycache__/rlcompleter.cpython-36.pyc matches /usr/lib/python3.6/rlcompleter.py
# code object from '/usr/lib/python3.6/__pycache__/rlcompleter.cpython-36.pyc'
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe24c30deb8>
codygreen commented 4 years ago

I was able to reproduce this issue on a customer's Ubuntu image today. Same error and version of Ubuntu.

shyawnkarim commented 4 years ago

Thank you for reporting this bug. I've filed a bug ticket for this. Internal ID AUTOSDK-298.

jmacnett commented 3 years ago

any word on this? did a fresh install on both centos 7 and centos 8 today w/o the vm solution, and im' seeing this same error for every command

shyawnkarim commented 3 years ago

We were able to duplicate this error with Python version 3.6.9. Updating to version 3.7.5 resolved the issue. Can you update your version of Python and let us know if you are still getting the same error?

jmacnett commented 3 years ago

centos boxes had issues w/ the python upgrade; however, I put python 3.7.3 on a WSL instance and it got past that particular error, at least, so it looks the versioning thing is probably pretty accurate in terms of what's happening there.

Thanks.