Announcement

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

  • Stata can not find python environment

    I was forced to remove my Anaconda installation by the IT-department and re-install a packaged version of Python. And now Stata can't seem to find any python environment at all.

    The excutable files are located here: C:\Users\johve\AppData\Local\Microsoft\WindowsApps \PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0
    In this folder I have abunch of executables: python.exe python3.exe python3.9.exe etc...

    So when i type
    Code:
    python search
    all I get is:
    Code:
    . python search
    ------------------------------------------------------------------------------------------------
     Python environments found:  
    ------------------------------------------------------------------------------------------------
    .
    Stata canät seem to forget the old installation:

    Code:
    . python query
    ------------------------------------------------------------------------------------------------
        Python Settings
          set python_exec      C:\Users\johve\AppData\Local\Continuum\anaconda3\python.exe
          set python_userpath  
    
        Python system information
          initialized          no
          version              3.7.4
          architecture         64-bit
          library path         C:\Users\johve\AppData\Local\Continuum\anaconda3\python37.dll
    ... and setting the new executable is not working:

    Code:
    . python set exec "C:\Users\johve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.P
    > ython.3.9_qbz5n2kfra8p0\python.exe"
    file C:\Users\johve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5
    > n2kfra8p0\python.exe not found
    r(601);
    
    .
    Thanks for the help!

  • #2
    Ok, so I'll have to make a small edit. It turned out that the executable actually was located here: C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python. 3.9_3.9.2800.0_x64__qbz5n2kfra8p0\python3.9.exe

    Now that didn't take me to far anyway because now I get this error:
    Code:
    . python
    failed to load the shared library C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3
    > .9_3.9.2800.0_x64__qbz5n2kfra8p0\python39.dll.
    r(7100);

    Comment


    • #3
      Does this Stata blog post provide any assistance?

      https://blog.stata.com/2020/08/18/st...to-use-python/

      Comment


      • #4
        Unfortunately not.... The thing is that even if I point Stata at the correct path for my executable it still won't find the environment for some reason:

        Code:
        . python query
        -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            Python Settings
              set python_exec      C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\python3.9.exe
              set python_userpath  
        
            Python system information
              initialized          no
              version              3.9.10
              architecture         64-bit
              library path         C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\python39.dll
        
        . 
        
        
        . python search
        -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         Python environments found:  
        -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        
        . python
        failed to load the shared library C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\python39.dll.
        r(7100);

        Comment

        Working...
        X