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

az command not working: import issue #9473

Closed
amramtamir opened this issue May 24, 2019 · 11 comments
Closed

az command not working: import issue #9473

amramtamir opened this issue May 24, 2019 · 11 comments
Assignees
Labels
H2-2019 Features to be finished by the second half of 2019 Packaging/Homebrew

Comments

@amramtamir
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az login

Errors:

cannot import name '_thread' from 'six.moves' (unknown location)
Traceback (most recent call last):
python3.7/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 560, in execute
    raise ex
cli/core/commands/__init__.py, ln 618, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 611, in _run_job
    six.reraise(*sys.exc_info())
Users/tamir.amram/six.py, ln 491, in reraise
    raise value
...
site-packages/dateutil/parser/__init__.py, ln 2, in <module>
    from ._parser import parse, parser, parserinfo
site-packages/dateutil/parser/_parser.py, ln 50, in <module>
    from .. import tz
site-packages/dateutil/tz/__init__.py, ln 2, in <module>
    from .tz import *
site-packages/dateutil/tz/tz.py, ln 21, in <module>
    from six.moves import _thread
ImportError: cannot import name '_thread' from 'six.moves' (unknown location)

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az login

Expected Behavior

Environment Summary

Darwin-18.5.0-x86_64-i386-64bit
Python 3.7.3
Shell: bash

azure-cli 2.0.64 *

Additional Context

@adewaleo
Copy link
Contributor

Hello @amramtamir, what is your CLI installation method?

@amramtamir
Copy link
Author

Hi,
brew install azure-cli

@yugangw-msft
Copy link
Contributor

@marstr, can you please take a look?

@marstr
Copy link
Member

marstr commented May 24, 2019

Investigating now

@marstr
Copy link
Member

marstr commented May 24, 2019

I need more information, @amramtamir! When I run brew install azure-clion my Mac running 10.14.4, all seems well. Is there anything special about your machine? Have you installed Python on your machine outside of using Homebrew?

@amramtamir
Copy link
Author

Hi @marstr ,
Nothing special on my Mac - I used brew to install python.
I also tried to:
reinstall azure-cli, python, brew, Six package.

@adewaleo
Copy link
Contributor

adewaleo commented May 28, 2019

Hi @marstr ,
Nothing special on my Mac - I used brew to install python.
I also tried to:
reinstall azure-cli, python, brew, Six package.

This might help? https://stackoverflow.com/questions/27630114/matplotlib-issue-on-os-x-importerror-cannot-import-name-thread

A comment below the top answer says updating your version of six might help

@amramtamir
Copy link
Author

amramtamir commented May 29, 2019

Hi @marstr
It seems to work!
I have done these steps:
opened python from the terminal
import six
print six.file

the output showed that the six.pyc and six.py was on my home path
I ran rm -rf six.*
and the "az" command is now working :)

@marstr
Copy link
Member

marstr commented May 29, 2019

This is troublesome to me, as my hope was that using a Virtualenv in the Homebrew installer would isolate us from these sorts of problems.

@lmazuel, my take away from this is that in addition to invoking the python inside of the virtualenv, I should be invoking it with the -s flag. Do you think that's the right conclusion?

@lmazuel
Copy link
Member

lmazuel commented May 29, 2019

@marstr venv should not load any system or user system directory by default, so that option should be useless. If you're able to show me an example with venv and user directory where "-s" makes a difference I'm curious :)
That being said, it seems the story is more subtle:
pypa/pip#4141
pypa/pip#5702

@achandmsft achandmsft added the H2-2019 Features to be finished by the second half of 2019 label Jun 13, 2019
@marstr
Copy link
Member

marstr commented Jun 17, 2019

I'm going to close this out as a one-off error for now. However, if other people stumble on this and it needs a fix from us, I'm happy to open it back up.

@marstr marstr closed this as completed Jun 17, 2019
@haroldrandom haroldrandom added H2-2019 Features to be finished by the second half of 2019 Packaging/Homebrew labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
H2-2019 Features to be finished by the second half of 2019 Packaging/Homebrew
Projects
None yet
Development

No branches or pull requests

7 participants