module loader error on ubuntu artful 0.1.0~b7-1 #4692

Open
blackboxsw opened this Issue Oct 17, 2017 · 6 comments

Comments

Projects
None yet
5 participants

blackboxsw commented Oct 17, 2017

Can't 'az login' from Ubuntu Artful

az login output

root@a1:~# az login
Error loading command module 'storage'
init() got multiple values for keyword argument 'default_completer'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/main.py", line 35, in main
cmd_result = APPLICATION.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/application.py", line 84, in execute
self.parser.load_command_table(command_table)
File "/usr/lib/python3/dist-packages/azure/cli/core/parser.py", line 91, in load_command_table
enable_autocomplete(self)
File "/usr/lib/python3/dist-packages/azure/cli/core/parser.py", line 34, in enable_autocomplete
argcomplete.autocomplete(parser, validator=lambda c, p: c.lower().startswith(p.lower()))
File "/usr/lib/python3/dist-packages/argcomplete/init.py", line 166, in call
default_completer=default_completer)
File "/usr/lib/python3/dist-packages/azure/cli/core/parser.py", line 30, in init
**kwargs)
TypeError: init() got multiple values for keyword argument 'default_completer'

Environment summary

root@a1:~# az --version
Python (Linux) 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0]

Install method: ubuntu: apt-get install azure-cli
Distribution: Ubuntu artful

root@a1:# apt policy azure-cli
azure-cli:
Installed: 0.1.0
b7-1
Candidate: 0.1.0b7-1
Version table:
*** 0.1.0
b7-1 500
500 http://archive.ubuntu.com/ubuntu artful/universe amd64 Packages
100 /var/lib/dpkg/status
root@a1:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="17.10 (Artful Aardvark)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu Artful Aardvark (development branch)"
VERSION_ID="17.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=artful
UBUNTU_CODENAME=artful

@yugangw-msft yugangw-msft changed the title from az login ubuntu artful 0.1.0~b7-1 to module loader error on ubuntu artful 0.1.0~b7-1 Oct 17, 2017

Contributor

yugangw-msft commented Oct 17, 2017

Pertinent piece:

Error loading command module 'storage'
init() got multiple values for keyword argument 'default_completer'
Member

derekbekoe commented Oct 17, 2017

If 0.1.0b7 is the version number of the CLI, this is an incredibly old version.
Did you install with the instructions here?
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-debianubuntu-with-apt-get

the default ubuntu image comes with a hint to install the azure cli which installs the outdated version

Member

derekbekoe commented Oct 31, 2017

the default ubuntu image comes with a hint to install the azure cli which installs the outdated version

@rafmathijs Can you provide more details for our own information?
I'm not aware of the above.

Member

bacongobbler commented Dec 20, 2017

I believe this is only relevant for users running on Ubuntu Artful (17.10).

As a user, when you run az in the terminal, you are met with the following error:

><> az
The program 'az' is currently not installed. You can install it by typing:
sudo apt install azure-cli

Running the instructions as followed gives you v0.1.0.

><> sudo apt install azure-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.13.0-16 linux-headers-4.13.0-16-generic linux-image-4.13.0-16-generic linux-image-extra-4.13.0-16-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  azure-cli
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 170 kB of archives.
After this operation, 2,108 kB of additional disk space will be used.
Get:1 http://ca.archive.ubuntu.com/ubuntu artful/universe amd64 azure-cli amd64 0.1.0~b7-1 [170 kB]
Fetched 170 kB in 1s (147 kB/s)
Selecting previously unselected package azure-cli.
(Reading database ... 222252 files and directories currently installed.)
Preparing to unpack .../azure-cli_0.1.0~b7-1_amd64.deb ...
Unpacking azure-cli (0.1.0~b7-1) ...
Setting up azure-cli (0.1.0~b7-1) ...

We should probably get this apt repository removed if we are maintaining a separate apt repository for azure-cli builds.

For reference, this is a completely vanilla install of Artful:

><> apt list | grep azure-cli

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

azure-cli/artful,now 0.1.0~b7-1 amd64 [installed]

Output of all sources:

><> cat /etc/apt/sources.list | grep -v "^$" | grep -v "^#"
deb http://ca.archive.ubuntu.com/ubuntu/ artful main restricted
deb http://ca.archive.ubuntu.com/ubuntu/ artful-updates main restricted
deb http://ca.archive.ubuntu.com/ubuntu/ artful universe
deb http://ca.archive.ubuntu.com/ubuntu/ artful-updates universe
deb http://ca.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ artful-updates multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://security.ubuntu.com/ubuntu artful-security universe
deb http://security.ubuntu.com/ubuntu artful-security multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu artful edge
Member

bacongobbler commented Dec 20, 2017

And as @derekbekoe pointed out, following the instructions from https://docs.microsoft.com to add the Ubuntu Wheezy repository and install azure-cli worked like a charm. For others, that'd be

echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
sudo apt-get install apt-transport-https
sudo apt-get update && sudo apt-get install azure-cli

Thanks Derek! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment