Latex and SymPy error











up vote
1
down vote

favorite












I try to make some calculations inside LaTeX. Therefore I want to use Sympy. So I put usepackage{sympytex} to the header and compile wit pdflatex. After compiling there occurs a .sympy file. The documentary of SympyTex tells to run these file now with python. If i do I receive the following error with python:



Traceback (most recent call last):
File "ErsterVersuch.sympy", line 4, in <module>
import sympytex
File "/usr/share/texlive/texmf-dist/scripts/sympytexpackage/sympytex.py", line 48, in <module>
from string import strip
ImportError: cannot import name 'strip'


Maybe some can explain me the problem.










share|improve this question
























  • As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
    – epR8GaYuh
    Dec 5 at 18:20















up vote
1
down vote

favorite












I try to make some calculations inside LaTeX. Therefore I want to use Sympy. So I put usepackage{sympytex} to the header and compile wit pdflatex. After compiling there occurs a .sympy file. The documentary of SympyTex tells to run these file now with python. If i do I receive the following error with python:



Traceback (most recent call last):
File "ErsterVersuch.sympy", line 4, in <module>
import sympytex
File "/usr/share/texlive/texmf-dist/scripts/sympytexpackage/sympytex.py", line 48, in <module>
from string import strip
ImportError: cannot import name 'strip'


Maybe some can explain me the problem.










share|improve this question
























  • As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
    – epR8GaYuh
    Dec 5 at 18:20













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I try to make some calculations inside LaTeX. Therefore I want to use Sympy. So I put usepackage{sympytex} to the header and compile wit pdflatex. After compiling there occurs a .sympy file. The documentary of SympyTex tells to run these file now with python. If i do I receive the following error with python:



Traceback (most recent call last):
File "ErsterVersuch.sympy", line 4, in <module>
import sympytex
File "/usr/share/texlive/texmf-dist/scripts/sympytexpackage/sympytex.py", line 48, in <module>
from string import strip
ImportError: cannot import name 'strip'


Maybe some can explain me the problem.










share|improve this question















I try to make some calculations inside LaTeX. Therefore I want to use Sympy. So I put usepackage{sympytex} to the header and compile wit pdflatex. After compiling there occurs a .sympy file. The documentary of SympyTex tells to run these file now with python. If i do I receive the following error with python:



Traceback (most recent call last):
File "ErsterVersuch.sympy", line 4, in <module>
import sympytex
File "/usr/share/texlive/texmf-dist/scripts/sympytexpackage/sympytex.py", line 48, in <module>
from string import strip
ImportError: cannot import name 'strip'


Maybe some can explain me the problem.







errors python






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 6 at 16:24









Sigur

23.7k355136




23.7k355136










asked Sep 6 at 14:13









LoLiebe

61




61












  • As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
    – epR8GaYuh
    Dec 5 at 18:20


















  • As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
    – epR8GaYuh
    Dec 5 at 18:20
















As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
– epR8GaYuh
Dec 5 at 18:20




As already pointed out in the given answer, you are using a deprecated/removed Python method. You may be able to use the existing code with Python 2, but as the official support for Python 2 will end at the end of 2019, you should consider switching to Python 3. Please provide a MWE.
– epR8GaYuh
Dec 5 at 18:20










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The string.strip() method appears to be provided with Python 2.7 (see here)




7.1.6. Deprecated string functions



The following list of functions are also defined as methods of string
and Unicode objects; see section String Methods for more information
on those. You should consider these functions as deprecated, although
they will not be removed until Python 3. The functions defined in this
module are:




but (as to be expected from quote above) not with Python 3.5 or later (see there).



You need to make sure you are using Python 2.x, not Python 3.x. (that's my guess at least).






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2ftex.stackexchange.com%2fquestions%2f449708%2flatex-and-sympy-error%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    The string.strip() method appears to be provided with Python 2.7 (see here)




    7.1.6. Deprecated string functions



    The following list of functions are also defined as methods of string
    and Unicode objects; see section String Methods for more information
    on those. You should consider these functions as deprecated, although
    they will not be removed until Python 3. The functions defined in this
    module are:




    but (as to be expected from quote above) not with Python 3.5 or later (see there).



    You need to make sure you are using Python 2.x, not Python 3.x. (that's my guess at least).






    share|improve this answer

























      up vote
      0
      down vote













      The string.strip() method appears to be provided with Python 2.7 (see here)




      7.1.6. Deprecated string functions



      The following list of functions are also defined as methods of string
      and Unicode objects; see section String Methods for more information
      on those. You should consider these functions as deprecated, although
      they will not be removed until Python 3. The functions defined in this
      module are:




      but (as to be expected from quote above) not with Python 3.5 or later (see there).



      You need to make sure you are using Python 2.x, not Python 3.x. (that's my guess at least).






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        The string.strip() method appears to be provided with Python 2.7 (see here)




        7.1.6. Deprecated string functions



        The following list of functions are also defined as methods of string
        and Unicode objects; see section String Methods for more information
        on those. You should consider these functions as deprecated, although
        they will not be removed until Python 3. The functions defined in this
        module are:




        but (as to be expected from quote above) not with Python 3.5 or later (see there).



        You need to make sure you are using Python 2.x, not Python 3.x. (that's my guess at least).






        share|improve this answer












        The string.strip() method appears to be provided with Python 2.7 (see here)




        7.1.6. Deprecated string functions



        The following list of functions are also defined as methods of string
        and Unicode objects; see section String Methods for more information
        on those. You should consider these functions as deprecated, although
        they will not be removed until Python 3. The functions defined in this
        module are:




        but (as to be expected from quote above) not with Python 3.5 or later (see there).



        You need to make sure you are using Python 2.x, not Python 3.x. (that's my guess at least).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 6 at 14:50









        jfbu

        45.7k65147




        45.7k65147






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • 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%2ftex.stackexchange.com%2fquestions%2f449708%2flatex-and-sympy-error%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

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?