Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfctl conflicts with recent azure-cli #72

Closed
wminos opened this issue Mar 4, 2018 · 6 comments
Closed

sfctl conflicts with recent azure-cli #72

wminos opened this issue Mar 4, 2018 · 6 comments

Comments

@wminos
Copy link

wminos commented Mar 4, 2018

[Info]

  • sfctl version: 4.0.0
  • azure cli version: 2.0.27
  • service fabric hosting location: azure

[Reason]

two recent cli uses incompatible knack library of different version.
current sfctl cli uses knack@0.1.1
current az cli uses knack@0.3.1

[Error]

PS C:\Users\me> pip install sfctl
PS C:\Users\me> pip install azure-cli
PS C:\Users\me> sfctl
Traceback (most recent call last):
File "c:\python36\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\me\AppData\Roaming\Python\Python36\Scripts\sfctl.exe_main
.py", line 5, in
File "C:\Users\me\AppData\Roaming\Python\Python36\site-packages\sfctl_init
.py", line 16, in
from sfctl.entry import launch
File "C:\Users\me\AppData\Roaming\Python\Python36\site-packages\sfctl\entry.py", line 16, in
from sfctl.commands import SFCommandLoader, SFCommandHelp
File "C:\Users\me\AppData\Roaming\Python\Python36\site-packages\sfctl\commands.py", line 14, in
from knack.commands import CLICommandsLoader, CommandSuperGroup
ImportError: cannot import name 'CommandSuperGroup'

[My solution]

PS> pip check
sfctl 4.0.0 has requirement knack==0.1.1, but you have knack 0.3.1.

PS> pip uninstall knack
PS> pip install knack==0.1.1

sfctl okay.
but azure-cli error occurs.

PS> az
init() got multiple values for argument 'ctx'
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\knack\cli.py", line 124, in invoke
initial_data=initial_invocation_data)
File "C:\Python36\lib\site-packages\knack\invocation.py", line 31, in init
self.parser = parser_cls(ctx=self.ctx, prog=self.ctx.name, parents=[self._global_parser])
File "C:\Users\me\AppData\Roaming\Python\Python36\site-packages\azure\cli\core\parser.py", line 39, in init
super(AzCliCommandParser, self).init(cli_ctx, cli_help=cli_help, **kwargs)
TypeError: init() got multiple values for argument 'ctx'

@wminos wminos changed the title sfctl cli conflicts with azure cli sfctl conflicts with recent azure-cli Mar 4, 2018
@samedder
Copy link
Collaborator

samedder commented Mar 5, 2018

@wminos as a workaround you can run either azure CLI or sfctl from a virtual environment, please take a look at the virtualenv package.

@wminos
Copy link
Author

wminos commented Mar 6, 2018

I am using virtualenv. Thank you.

@wminos wminos closed this as completed Mar 7, 2018
@samedder
Copy link
Collaborator

samedder commented Mar 7, 2018

@wminos I created an issue from this, #73, to make sure in the future we do upgrade the knack package.

@ryankmcintyre
Copy link

I ran into this and created a container that loads from azure-cli and then installs tmux and uses a virtualenv to load sfctl in a separate environment loaded in a tmux pane. Now my left pane runs az and the right pane runs sfctl. In case someone else finds it useful until the knack version is fixed: https://hub.docker.com/r/ryanmcintyre/sfctl/

@wminos
Copy link
Author

wminos commented Mar 10, 2018

@ryankmcintyre Very cool idea. However, I mainly develop under windows environment and do not use tmux. But it would be useful in a WSL environment.

@ryankmcintyre
Copy link

ryankmcintyre commented Mar 10, 2018 via email

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

No branches or pull requests

3 participants