Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • python integration, "Unable to find shared library."

    Hi Statalist,

    I am trying to integrate python with Stata. I am running into a pair of errors, the second of which I do not fully understand.

    First, I try to call python and receive the following error:

    Code:
    python
    minimum Python version required is 2.7
    r(111);
    This was initially confusing because I have python 3.7 on this computer (Windows 10 OS). I read some online resources suggesting I need to specify the path to my python app, but when I do, I receive a second error:

    Code:
    python set exec "path\to\my\python\directory\python.exe"
    failed to set the specified Python version.
    Unable to find the shared library.
    r(601);
    The tech guys at my office are trying to assist -- it could be something related to file permissions? -- but I would appreciate any expertise on what the problem is here. I do not know what a "shared library" is.

    Thanks,

    Julian

  • #2
    Can you show the exact path to your python installation?

    Comment


    • #3
      Sure, it is "C:\Users\jduggan\AppData\Local\Programs\Python\Py thon37-32\python.exe" [oddly, it is adding a space between the y and the t in the final folder when i copy paste it here -- ignore that, it isn't a part of the file path]
      Last edited by Julian Duggan; 15 Jan 2020, 13:35. Reason: weird formatting when i copy paste the file path has been noted

      Comment


      • #4
        that "C:\Users\jduggan\AppData\Local\Programs\Python\Py thon37-32\python.exe"

        Comment


        • #5
          "C:\Users\jduggan\AppData\Local\Programs\Pytho n\Py thon37-32\python.exe"
          I had the same thing earlier - apparently Stata wants to match the version of the Python, and the guide is silent about it, but this is probably implied as a general knowledge. See here for details:
          https://docs.microsoft.com/en-us/win...teroperability
          Hence we are always to compile 2 versions of our plugins 32- and 64-bit, even if there is no difference in the source code being compiled.

          If you are using a 64-bit version of Stata, install a 64-bit version of Python, otherwise it will not accept it even if you are doing everything correctly and Python responds from the command line.

          At least, this was my experience [coincidentally] with 32-bit v3.7, and which was solved once I installed 64-bit 3.8 which is out there.

          Best, Sergiy Radyakin

          Comment


          • #6
            Ahh wow thank you, I would never have known... I will use the 64 bit and let you know if it works.

            Comment


            • #7
              Downloading the 64bit version solved my problem. Thank you Sergiy!

              Comment


              • #8
                You are welcome!

                Comment

                Working...
                X