GSPy GoldSim/Python Interface issue

Answered

Comments

4 comments

  • Avatar
    Thai Phan

    Resolved.

    I realized that I had to open powershell from Anaconda rather than directly from Windows.

    1
    Comment actions Permalink
  • Avatar
    Jason

    Thai Pan,

    I'm glad you figured it out. I wonder if that means that the python environment saved to your path that the regular command line uses is different from that of Anaconda. Do you have more than 1 Python environment set up on that computer? It probably doesn't matter at this point, but it would be nice to know why this didn't work using the Windows command line. 

    -Jason

    0
    Comment actions Permalink
  • Avatar
    Thai Phan

    Yes, you are right that there was another previously installed python version that I was not aware of (and did not check the system prior to installation of Anaconda). The disadvantage is that I now have to run GoldSim through the commander window in order for the GSPy binary to work properly. If I load GoldSim through Window, the python version associated with GSPy cannot be read properly. Is there an easy fix for this (e.g., simply uninstall the previously installed python)? The GSPy dll works for me now, just a bit inconvenient that I have to load GoldSim from the command window via Anaconda.

    Thai

    0
    Comment actions Permalink
  • Avatar
    Jason

    Thai,

    I suggest you try (in case you haven't already) to check your Windows path and if needed, make it the same Python environment used on the Anaconda side. On the Windows terminal, start the Python interpreter then enter these commands:

    import os
    import sys
    print(os.path.dirname(sys.executable))

    This will print the directory path where python.exe is installed.

    If you do this on the Anaconda terminal, do you get something different? If they are different, then you can add a new python to PATH: How to Add Python to PATH – Real Python.

    Does this help?

    -Jason

    PS - If you haven't done so already, a great way to ensure consistency in python environments when you share with other computers is to use the virtual environment: Python Virtual Environments: A Primer – Real Python

    0
    Comment actions Permalink

Please sign in to leave a comment.