python : cannot import name JIRA









up vote
6
down vote

favorite












I have already done pip install jira



but when I run the following it fails with ImportError: cannot import name JIRA



import re
from jira import JIRA

jira = JIRA('https://issues.net')
# all values are samples and won't work in your code!
key_cert_data = None
key_cert_file = "cert/jiraprivatekey.pub"
with open(key_cert, 'r') as key_cert_file:
key_cert_data = key_cert_file.read()









share|improve this question





















  • Possible duplicate of ImportError: Cannot import name X
    – nbrooks
    Jan 12 '17 at 20:02














up vote
6
down vote

favorite












I have already done pip install jira



but when I run the following it fails with ImportError: cannot import name JIRA



import re
from jira import JIRA

jira = JIRA('https://issues.net')
# all values are samples and won't work in your code!
key_cert_data = None
key_cert_file = "cert/jiraprivatekey.pub"
with open(key_cert, 'r') as key_cert_file:
key_cert_data = key_cert_file.read()









share|improve this question





















  • Possible duplicate of ImportError: Cannot import name X
    – nbrooks
    Jan 12 '17 at 20:02












up vote
6
down vote

favorite









up vote
6
down vote

favorite











I have already done pip install jira



but when I run the following it fails with ImportError: cannot import name JIRA



import re
from jira import JIRA

jira = JIRA('https://issues.net')
# all values are samples and won't work in your code!
key_cert_data = None
key_cert_file = "cert/jiraprivatekey.pub"
with open(key_cert, 'r') as key_cert_file:
key_cert_data = key_cert_file.read()









share|improve this question













I have already done pip install jira



but when I run the following it fails with ImportError: cannot import name JIRA



import re
from jira import JIRA

jira = JIRA('https://issues.net')
# all values are samples and won't work in your code!
key_cert_data = None
key_cert_file = "cert/jiraprivatekey.pub"
with open(key_cert, 'r') as key_cert_file:
key_cert_data = key_cert_file.read()






python python-2.7 python-3.x jira python-jira






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 12 '17 at 19:38









Scooby

94162153




94162153











  • Possible duplicate of ImportError: Cannot import name X
    – nbrooks
    Jan 12 '17 at 20:02
















  • Possible duplicate of ImportError: Cannot import name X
    – nbrooks
    Jan 12 '17 at 20:02















Possible duplicate of ImportError: Cannot import name X
– nbrooks
Jan 12 '17 at 20:02




Possible duplicate of ImportError: Cannot import name X
– nbrooks
Jan 12 '17 at 20:02












3 Answers
3






active

oldest

votes

















up vote
12
down vote













fixed it.



The file I was running was called jira.py so when I did from



jira import JIRA



It was trying to look up self.






share|improve this answer
















  • 1




    I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
    – std''OrgnlDave
    Jan 12 '17 at 20:16










  • @std''OrgnlDave Can you explain how?
    – MonkeyMonkey
    Jun 21 '17 at 19:57










  • @MonkeyMonkey added an answer explaining how
    – HMagdy
    Apr 13 at 13:59


















up vote
0
down vote













In addition to @Organ note




I'd like to note that you can turn on absolute import paths and keep
your file named jira.py if it makes sense to you to do that




In my case, I did this twice:



from jira import JIRA
jira = JIRA(URL_JIRA, basic_auth=('abc', '123'))


So in the first show, it's working good because jira is the global namespace but in second usage it doesn't because jira became just instance of JIRA.



This is my solution based on Organ's note:



import jira.client
x = jira.client.JIRA(URL_JIRA, basic_auth=('123', 'abc'))


Here, you can keep having jira.py and use these lines as much as you need.






share|improve this answer



























    up vote
    0
    down vote













    I started getting this error when I installed python 3.6,earlier I had python 2.7.
    and jira was working.
    I renamed the python3.6 exe as python3 and python 2.7 exe as python,
    issue got resolved






    share|improve this answer




















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41621566%2fpython-cannot-import-name-jira%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      12
      down vote













      fixed it.



      The file I was running was called jira.py so when I did from



      jira import JIRA



      It was trying to look up self.






      share|improve this answer
















      • 1




        I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
        – std''OrgnlDave
        Jan 12 '17 at 20:16










      • @std''OrgnlDave Can you explain how?
        – MonkeyMonkey
        Jun 21 '17 at 19:57










      • @MonkeyMonkey added an answer explaining how
        – HMagdy
        Apr 13 at 13:59















      up vote
      12
      down vote













      fixed it.



      The file I was running was called jira.py so when I did from



      jira import JIRA



      It was trying to look up self.






      share|improve this answer
















      • 1




        I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
        – std''OrgnlDave
        Jan 12 '17 at 20:16










      • @std''OrgnlDave Can you explain how?
        – MonkeyMonkey
        Jun 21 '17 at 19:57










      • @MonkeyMonkey added an answer explaining how
        – HMagdy
        Apr 13 at 13:59













      up vote
      12
      down vote










      up vote
      12
      down vote









      fixed it.



      The file I was running was called jira.py so when I did from



      jira import JIRA



      It was trying to look up self.






      share|improve this answer












      fixed it.



      The file I was running was called jira.py so when I did from



      jira import JIRA



      It was trying to look up self.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jan 12 '17 at 20:00









      Scooby

      94162153




      94162153







      • 1




        I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
        – std''OrgnlDave
        Jan 12 '17 at 20:16










      • @std''OrgnlDave Can you explain how?
        – MonkeyMonkey
        Jun 21 '17 at 19:57










      • @MonkeyMonkey added an answer explaining how
        – HMagdy
        Apr 13 at 13:59













      • 1




        I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
        – std''OrgnlDave
        Jan 12 '17 at 20:16










      • @std''OrgnlDave Can you explain how?
        – MonkeyMonkey
        Jun 21 '17 at 19:57










      • @MonkeyMonkey added an answer explaining how
        – HMagdy
        Apr 13 at 13:59








      1




      1




      I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
      – std''OrgnlDave
      Jan 12 '17 at 20:16




      I'd like to note that you can turn on absolute import paths and keep your file named jira.py if it makes sense to you to do that
      – std''OrgnlDave
      Jan 12 '17 at 20:16












      @std''OrgnlDave Can you explain how?
      – MonkeyMonkey
      Jun 21 '17 at 19:57




      @std''OrgnlDave Can you explain how?
      – MonkeyMonkey
      Jun 21 '17 at 19:57












      @MonkeyMonkey added an answer explaining how
      – HMagdy
      Apr 13 at 13:59





      @MonkeyMonkey added an answer explaining how
      – HMagdy
      Apr 13 at 13:59













      up vote
      0
      down vote













      In addition to @Organ note




      I'd like to note that you can turn on absolute import paths and keep
      your file named jira.py if it makes sense to you to do that




      In my case, I did this twice:



      from jira import JIRA
      jira = JIRA(URL_JIRA, basic_auth=('abc', '123'))


      So in the first show, it's working good because jira is the global namespace but in second usage it doesn't because jira became just instance of JIRA.



      This is my solution based on Organ's note:



      import jira.client
      x = jira.client.JIRA(URL_JIRA, basic_auth=('123', 'abc'))


      Here, you can keep having jira.py and use these lines as much as you need.






      share|improve this answer
























        up vote
        0
        down vote













        In addition to @Organ note




        I'd like to note that you can turn on absolute import paths and keep
        your file named jira.py if it makes sense to you to do that




        In my case, I did this twice:



        from jira import JIRA
        jira = JIRA(URL_JIRA, basic_auth=('abc', '123'))


        So in the first show, it's working good because jira is the global namespace but in second usage it doesn't because jira became just instance of JIRA.



        This is my solution based on Organ's note:



        import jira.client
        x = jira.client.JIRA(URL_JIRA, basic_auth=('123', 'abc'))


        Here, you can keep having jira.py and use these lines as much as you need.






        share|improve this answer






















          up vote
          0
          down vote










          up vote
          0
          down vote









          In addition to @Organ note




          I'd like to note that you can turn on absolute import paths and keep
          your file named jira.py if it makes sense to you to do that




          In my case, I did this twice:



          from jira import JIRA
          jira = JIRA(URL_JIRA, basic_auth=('abc', '123'))


          So in the first show, it's working good because jira is the global namespace but in second usage it doesn't because jira became just instance of JIRA.



          This is my solution based on Organ's note:



          import jira.client
          x = jira.client.JIRA(URL_JIRA, basic_auth=('123', 'abc'))


          Here, you can keep having jira.py and use these lines as much as you need.






          share|improve this answer












          In addition to @Organ note




          I'd like to note that you can turn on absolute import paths and keep
          your file named jira.py if it makes sense to you to do that




          In my case, I did this twice:



          from jira import JIRA
          jira = JIRA(URL_JIRA, basic_auth=('abc', '123'))


          So in the first show, it's working good because jira is the global namespace but in second usage it doesn't because jira became just instance of JIRA.



          This is my solution based on Organ's note:



          import jira.client
          x = jira.client.JIRA(URL_JIRA, basic_auth=('123', 'abc'))


          Here, you can keep having jira.py and use these lines as much as you need.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 13 at 13:59









          HMagdy

          2,3722741




          2,3722741




















              up vote
              0
              down vote













              I started getting this error when I installed python 3.6,earlier I had python 2.7.
              and jira was working.
              I renamed the python3.6 exe as python3 and python 2.7 exe as python,
              issue got resolved






              share|improve this answer
























                up vote
                0
                down vote













                I started getting this error when I installed python 3.6,earlier I had python 2.7.
                and jira was working.
                I renamed the python3.6 exe as python3 and python 2.7 exe as python,
                issue got resolved






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  I started getting this error when I installed python 3.6,earlier I had python 2.7.
                  and jira was working.
                  I renamed the python3.6 exe as python3 and python 2.7 exe as python,
                  issue got resolved






                  share|improve this answer












                  I started getting this error when I installed python 3.6,earlier I had python 2.7.
                  and jira was working.
                  I renamed the python3.6 exe as python3 and python 2.7 exe as python,
                  issue got resolved







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 10 at 15:08









                  sgupt

                  1




                  1



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41621566%2fpython-cannot-import-name-jira%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

                      Syphilis

                      Darth Vader #20