python import a non standard library












1














Hi I downloaded a cool github to run in jupyter notebook.
however I need to import this "non standard library" by the author




  1. downloaded the files

  2. I put the file in the same folder, made sure that my notebook is pointing there.

  3. type "import indicators" in the notebook
    (by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)


and I get this error




Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
import indicators
File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
val_last = val
^
TabError: inconsistent use of tabs and spaces in indentation




just in case I open the command line and type "pip install indicators.py"
but I get an error:




" Could not find a version that satisfies the requirement indicators.py (from versions: )
No matching distribution found for indicators.py"




help please!










share|improve this question





























    1














    Hi I downloaded a cool github to run in jupyter notebook.
    however I need to import this "non standard library" by the author




    1. downloaded the files

    2. I put the file in the same folder, made sure that my notebook is pointing there.

    3. type "import indicators" in the notebook
      (by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)


    and I get this error




    Traceback (most recent call last):
    File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
    File "", line 5, in
    import indicators
    File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
    val_last = val
    ^
    TabError: inconsistent use of tabs and spaces in indentation




    just in case I open the command line and type "pip install indicators.py"
    but I get an error:




    " Could not find a version that satisfies the requirement indicators.py (from versions: )
    No matching distribution found for indicators.py"




    help please!










    share|improve this question



























      1












      1








      1







      Hi I downloaded a cool github to run in jupyter notebook.
      however I need to import this "non standard library" by the author




      1. downloaded the files

      2. I put the file in the same folder, made sure that my notebook is pointing there.

      3. type "import indicators" in the notebook
        (by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)


      and I get this error




      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
      File "", line 5, in
      import indicators
      File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
      val_last = val
      ^
      TabError: inconsistent use of tabs and spaces in indentation




      just in case I open the command line and type "pip install indicators.py"
      but I get an error:




      " Could not find a version that satisfies the requirement indicators.py (from versions: )
      No matching distribution found for indicators.py"




      help please!










      share|improve this question















      Hi I downloaded a cool github to run in jupyter notebook.
      however I need to import this "non standard library" by the author




      1. downloaded the files

      2. I put the file in the same folder, made sure that my notebook is pointing there.

      3. type "import indicators" in the notebook
        (by the way its a file called indicators.py in https://github.com/voice32/stock_market_indicators/)


      and I get this error




      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packagesIPythoncoreinteractiveshell.py", line 2961, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
      File "", line 5, in
      import indicators
      File "C:Usersney12Google Drive1) Financial Mastery3) paper assets, trading, Other assetsforexVan tharp Forex trading systemNey study of van tharp forex trading systemForex-initial-analysisindicators.py", line 235
      val_last = val
      ^
      TabError: inconsistent use of tabs and spaces in indentation




      just in case I open the command line and type "pip install indicators.py"
      but I get an error:




      " Could not find a version that satisfies the requirement indicators.py (from versions: )
      No matching distribution found for indicators.py"




      help please!







      python github jupyter-notebook jupyter






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 at 6:08









      Julian Peller

      849511




      849511










      asked Nov 21 at 3:04









      Ney J Torres

      112118




      112118
























          2 Answers
          2






          active

          oldest

          votes


















          2














          The error is in the stacktrace:



          TabError: inconsistent use of tabs and spaces in indentation


          This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating



          I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t char in the find bar (note the escape slash), and then either s{4} (if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell






          share|improve this answer





















          • you where right!!!
            – Ney J Torres
            Nov 21 at 3:16






          • 1




            Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
            – bro-grammer
            Nov 21 at 3:31






          • 1




            @bro-grammer that's really cool, never knew you could do that
            – C.Nivs
            Nov 21 at 3:33



















          2














          Run autopep8 on the module you downloaded.



          i.e.



          pip install autopep8
          autopep8 --in-place <File.py>


          You now should be good to go






          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',
            autoActivateHeartbeat: false,
            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%2f53404707%2fpython-import-a-non-standard-library%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            The error is in the stacktrace:



            TabError: inconsistent use of tabs and spaces in indentation


            This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating



            I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t char in the find bar (note the escape slash), and then either s{4} (if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell






            share|improve this answer





















            • you where right!!!
              – Ney J Torres
              Nov 21 at 3:16






            • 1




              Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
              – bro-grammer
              Nov 21 at 3:31






            • 1




              @bro-grammer that's really cool, never knew you could do that
              – C.Nivs
              Nov 21 at 3:33
















            2














            The error is in the stacktrace:



            TabError: inconsistent use of tabs and spaces in indentation


            This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating



            I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t char in the find bar (note the escape slash), and then either s{4} (if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell






            share|improve this answer





















            • you where right!!!
              – Ney J Torres
              Nov 21 at 3:16






            • 1




              Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
              – bro-grammer
              Nov 21 at 3:31






            • 1




              @bro-grammer that's really cool, never knew you could do that
              – C.Nivs
              Nov 21 at 3:33














            2












            2








            2






            The error is in the stacktrace:



            TabError: inconsistent use of tabs and spaces in indentation


            This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating



            I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t char in the find bar (note the escape slash), and then either s{4} (if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell






            share|improve this answer












            The error is in the stacktrace:



            TabError: inconsistent use of tabs and spaces in indentation


            This happens when someone uses tabs and spaces interchangeably for indentation in a script. Quite frustrating



            I'd suggest opening that file in the text editor of your choice and doing a bulk find-and-replace of tabs and replace with spaces. You can do that with the t char in the find bar (note the escape slash), and then either s{4} (if regex is enabled) or just hit space 4 times in the replace field. Save it, then re-import it with a fresh python shell







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 21 at 3:09









            C.Nivs

            1,8271414




            1,8271414












            • you where right!!!
              – Ney J Torres
              Nov 21 at 3:16






            • 1




              Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
              – bro-grammer
              Nov 21 at 3:31






            • 1




              @bro-grammer that's really cool, never knew you could do that
              – C.Nivs
              Nov 21 at 3:33


















            • you where right!!!
              – Ney J Torres
              Nov 21 at 3:16






            • 1




              Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
              – bro-grammer
              Nov 21 at 3:31






            • 1




              @bro-grammer that's really cool, never knew you could do that
              – C.Nivs
              Nov 21 at 3:33
















            you where right!!!
            – Ney J Torres
            Nov 21 at 3:16




            you where right!!!
            – Ney J Torres
            Nov 21 at 3:16




            1




            1




            Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
            – bro-grammer
            Nov 21 at 3:31




            Or you can reindent the entire directory by using autopep8 package_dir --recursive --select=E101,E121 --in-place. You need to install autopep8 using pip!
            – bro-grammer
            Nov 21 at 3:31




            1




            1




            @bro-grammer that's really cool, never knew you could do that
            – C.Nivs
            Nov 21 at 3:33




            @bro-grammer that's really cool, never knew you could do that
            – C.Nivs
            Nov 21 at 3:33













            2














            Run autopep8 on the module you downloaded.



            i.e.



            pip install autopep8
            autopep8 --in-place <File.py>


            You now should be good to go






            share|improve this answer


























              2














              Run autopep8 on the module you downloaded.



              i.e.



              pip install autopep8
              autopep8 --in-place <File.py>


              You now should be good to go






              share|improve this answer
























                2












                2








                2






                Run autopep8 on the module you downloaded.



                i.e.



                pip install autopep8
                autopep8 --in-place <File.py>


                You now should be good to go






                share|improve this answer












                Run autopep8 on the module you downloaded.



                i.e.



                pip install autopep8
                autopep8 --in-place <File.py>


                You now should be good to go







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 at 7:18









                Tim Seed

                1,8911616




                1,8911616






























                    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%2f53404707%2fpython-import-a-non-standard-library%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

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python