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

Error "ModuleNotFoundError: No module named 'keyring'" when trying to use jirashell #1435

Closed
2 of 4 tasks
joegiglio opened this issue Jul 26, 2022 · 5 comments · Fixed by #1709
Closed
2 of 4 tasks
Labels
docs good first issue New contributors welcome !

Comments

@joegiglio
Copy link

joegiglio commented Jul 26, 2022

Bug summary

The jira package itself works fine, but if I try to run jirashell from the terminal, I get:

ModuleNotFoundError: No module named 'keyring'

Here is my current list of packages (pip freeze) from a venv I created yesterday:

certifi==2022.6.15
charset-normalizer==2.1.0
defusedxml==0.7.1
idna==3.3
jira==3.3.0
oauthlib==3.2.0
packaging==21.3
pyparsing==3.0.9
requests==2.28.1
requests-oauthlib==1.3.1
requests-toolbelt==0.9.1
typing_extensions==4.3.0
urllib3==1.26.11

If I manually install keying using pip and try again, I get "No module named 'IPython'"

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

No response

jira-python version

3.3.0

Python Interpreter version

3.9.10

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

# 1. Type jirashell from a terminal

Stack trace

Traceback (most recent call last):
  File "/Users/joe/dev/mine/jira/venv/bin/jirashell", line 5, in <module>
    from jira.jirashell import main
  File "/Users/joe/dev/mine/jira/venv/lib/python3.9/site-packages/jira/jirashell.py", line 15, in <module>
    import keyring
ModuleNotFoundError: No module named 'keyring'

Expected behaviour

Jirashell should run without error

Additional Context

No response

@adehad
Copy link
Contributor

adehad commented Jul 26, 2022

Gotcha, I think this might be a documentation problem, as to use jirashell you need to
pip install jira[cli]

@adehad adehad added docs good first issue New contributors welcome ! labels Jul 26, 2022
@joegiglio
Copy link
Author

I tried that suggestion and I get:

mine/jira % pip install jira[cli]
zsh: no matches found: jira[cli]

I found a jira-cli and tried to install that but then got this error:

Collecting jira-cli
  Downloading jira_cli-3.0-py3-none-any.whl (27 kB)
Requirement already satisfied: jira in ./venv/lib/python3.9/site-packages (from jira-cli) (3.3.0)
Requirement already satisfied: requests in ./venv/lib/python3.9/site-packages (from jira-cli) (2.28.1)
Collecting suds-jurko
  Downloading suds-jurko-0.6.zip (255 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 255.8/255.8 kB 3.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in suds-jurko setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@joegiglio
Copy link
Author

I found a suggested fix for that error: pip install 'setuptools==58.0.0' and was able to get past the installation of jira-cli.

However, I have the same problem when running jirashell: No module named 'IPython'

@adehad
Copy link
Contributor

adehad commented Jul 27, 2022

hmmm jira-cli is not managed by us

The [] syntax is for installing "extras", we have defined the extras for jirashell here:

jira/setup.cfg

Lines 63 to 66 in 49fe68c

[options.extras_require]
cli =
ipython>=4.0.0
keyring

Which is where we specify keyring and ipython to be installed.

I am surprised that you aren't able to use the command successfully, this is my output (using pip 22.2):

pip install jira[cli]
Collecting jira[cli]
  Using cached jira-3.3.1-py3-none-any.whl (70 kB)
Requirement already satisfied: typing-extensions>=3.7.4.2 in c:\python38\lib\site-packages (from jira[cli]) (4.2.0)
Collecting requests>=2.10.0
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting defusedxml
  Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting requests-oauthlib>=1.1.0
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting requests-toolbelt
  Using cached requests_toolbelt-0.9.1-py2.py3-none-any.whl (54 kB)
Requirement already satisfied: packaging in c:\python38\lib\site-packages (from jira[cli]) (21.3)
Collecting keyring
  Downloading keyring-23.7.0-py3-none-any.whl (34 kB)
Collecting ipython>=4.0.0
  Using cached ipython-8.4.0-py3-none-any.whl (750 kB)
Collecting matplotlib-inline
  Using cached matplotlib_inline-0.1.3-py3-none-any.whl (8.2 kB)
Collecting jedi>=0.16
  Using cached jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
Collecting traitlets>=5
  Using cached traitlets-5.3.0-py3-none-any.whl (106 kB)
Collecting stack-data
  Using cached stack_data-0.3.0-py3-none-any.whl (23 kB)
Collecting decorator
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting backcall
  Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting pygments>=2.4.0
  Using cached Pygments-2.12.0-py3-none-any.whl (1.1 MB)
Requirement already satisfied: setuptools>=18.5 in c:\python38\lib\site-packages (from ipython>=4.0.0->jira[cli]) (56.0.0)
Requirement already satisfied: colorama in c:\users\adel haddad\appdata\roaming\python\python38\site-packages (from ipython>=4.0.0->jira[cli]) (0.4.4)
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
  Using cached prompt_toolkit-3.0.30-py3-none-any.whl (381 kB)
Collecting pickleshare
  Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2022.6.15-py3-none-any.whl (160 kB)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.11-py2.py3-none-any.whl (139 kB)
Collecting oauthlib>=3.0.0
  Using cached oauthlib-3.2.0-py3-none-any.whl (151 kB)
Collecting pywin32-ctypes!=0.1.0,!=0.1.1
  Downloading pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting importlib-metadata>=3.6
  Downloading importlib_metadata-4.12.0-py3-none-any.whl (21 kB)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\adel haddad\appdata\roaming\python\python38\site-packages (from packaging->jira[cli]) (3.0.7)
Collecting zipp>=0.5
  Downloading zipp-3.8.1-py3-none-any.whl (5.6 kB)
Collecting parso<0.9.0,>=0.8.0
  Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB)
Collecting wcwidth
  Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting pure-eval
  Using cached pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting asttokens
  Using cached asttokens-2.0.5-py2.py3-none-any.whl (20 kB)
Collecting executing
  Using cached executing-0.9.1-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: six in c:\python38\lib\site-packages (from asttokens->stack-data->ipython>=4.0.0->jira[cli]) (1.16.0)
Would install Pygments-2.12.0 asttokens-2.0.5 backcall-0.2.0 certifi-2022.6.15 charset-normalizer-2.1.0 decorator-5.1.1 defusedxml-0.7.1 executing-0.9.1 idna-3.3 importlib-metadata-4.12.0 ipython-8.4.0 jedi-0.18.1 jira-3.3.1 keyring-23.7.0 matplotlib-inline-0.1.3 oauthlib-3.2.0 parso-0.8.3 pickleshare-0.7.5 prompt-toolkit-3.0.30 pure-eval-0.2.2 pywin32-ctypes-0.2.0 requests-2.28.1 requests-oauthlib-1.3.1 requests-toolbelt-0.9.1 stack-data-0.3.0 traitlets-5.3.0 urllib3-1.26.11 wcwidth-0.2.5 zipp-3.8.1

@SeeMoreGain
Copy link

Just for anyone else who happens to see this, it is a problem with zsh not pip or jira.
zsh will use the square brackets for globbing, so this can be worked around by putting the package in literals ie
pip install 'jira[cli]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs good first issue New contributors welcome !
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants