Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 43

Thread: Help installing PySAL on win10...

  1. #31
    Administrator
    Join Date
    Jan 2014
    Posts
    9,105
    If you open up the python prompt in QGIS and run:

    import sys
    sys.path
    What does it say?

  2. #32
    Administrator
    Join Date
    Jan 2014
    Posts
    9,105
    If you open up the python prompt in QGIS and run:

    import sys
    sys.path
    What does it say?

  3. #33
    Ask me about my bottom br FaultyMario's Avatar
    Join Date
    Jan 2014
    Location
    ox.mx
    Posts
    8,460
    This:

    Code:
    sys.path
    ['C:\\Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins\\spatialanalysistoolbox',
     'C:/PROGRA~1/QGIS32~1.4/apps/qgis-ltr/./python',
     'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python',
     'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins',
     'C:/PROGRA~1/QGIS32~1.4/apps/qgis-ltr/./python/plugins',
     'C:\\Program Files\\QGIS 3.28.4\\bin\\python39.zip',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\DLLs',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\lib',
     'C:\\Program Files\\QGIS 3.28.4\\bin',
     'C:\\Users\\ciber\\AppData\\Roaming\\Python\\Python39\\site-packages',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\lib\\site-packages',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\lib\\site-packages\\win32',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\lib\\site-packages\\win32\\lib',
     'C:\\PROGRA~1\\QGIS32~1.4\\apps\\Python39\\lib\\site-packages\\Pythonwin',
     'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python']
    (I've added some line breaks to make it easier on the eyes).
    acket.

  4. #34
    Ask me about my bottom br FaultyMario's Avatar
    Join Date
    Jan 2014
    Location
    ox.mx
    Posts
    8,460
    What version QGis are you running Tom? I'm on 3.28 and I just checked the release notes for 3.3x and I think they repacked/rebuilt the python dependencies.

    PySAL appears on the list of "updated" python extensions.

    If it turns out that it was all a matter of updating to the latest stable release, I'm going postal.
    acket.

  5. #35
    Administrator
    Join Date
    Jan 2014
    Posts
    9,105
    I'm on 3.36.2. One thing I'm noticing from your previous screenshots is the two paths I see, c:\users\ciber\appdata\local\programs\python\pytho n312\lib\site-packages and c:\program files\qgis 3.28.4\apps\python39\lib\site-packages, are not present in that sys.path list.

    On the version I'm on, under Settings -> Options -> System, there's a list of environment variables down near the bottom of that screen. One of them is PYTHONPATH, it might work to try to add one (or both) of those directories to that value, separated by semicolons. I'd probably just focus on the second of those paths though, that's likely where you'd want to be pulling your packages from.

    Oh, and to save you the effort of adding newlines next time, I should have had you run

    import sys
    print('\n'.join(sys.path))

  6. #36
    Ask me about my bottom br FaultyMario's Avatar
    Join Date
    Jan 2014
    Location
    ox.mx
    Posts
    8,460
    installed 3.34 (latest stable release) and then sys.path

    'C:/PROGRA~1/QGIS33~1.6/apps/qgis-ltr/./python',
    'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python',
    'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python/plugins',
    'C:/PROGRA~1/QGIS33~1.6/apps/qgis-ltr/./python/plugins',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\grass\\grass83\\e tc\\python',
    'C:\\Users\\ciber\\Documents', 'C:\\Program Files\\QGIS 3.34.6\\bin\\python312.zip',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\DLLs',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\Lib',
    'C:\\Program Files\\QGIS 3.34.6\\bin',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\Lib\\s ite-packages',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\Lib\\s ite-packages\\win32',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\Lib\\s ite-packages\\win32\\lib',
    'C:\\PROGRA~1\\QGIS33~1.6\\apps\\Python312\\Lib\\s ite-packages\\Pythonwin',
    'C:/Users/ciber/AppData/Roaming/QGIS/QGIS3\\profiles\\default/python'
    acket.

  7. #37
    Administrator
    Join Date
    Jan 2014
    Posts
    9,105
    Okay. So if you go in file explorer to C:\Program Files\QGIS 3.34.6, there should be a file in there called OSGeo4W.bat. If you double click on that, it should open up a command prompt.

    From there, run python and do the same thing as above. Here's the contents of my command prompt window when doing that:

    run o-help for a list of available commands
    I:\Program Files\QGIS>python
    Python 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> print('\n'.join(sys.path))

    I:\Program Files\QGIS\bin\python312.zip
    I:\Program Files\QGIS\apps\Python312\DLLs
    I:\Program Files\QGIS\apps\Python312\Lib
    I:\Program Files\QGIS\bin
    C:\Users\swervo\AppData\Roaming\Python\Python312\s ite-packages
    I:\Program Files\QGIS\apps\Python312
    I:\Program Files\QGIS\apps\Python312\Lib\site-packages
    I:\Program Files\QGIS\apps\Python312\Lib\site-packages\win32
    I:\Program Files\QGIS\apps\Python312\Lib\site-packages\win32\lib
    I:\Program Files\QGIS\apps\Python312\Lib\site-packages\Pythonwin
    >>>

  8. #38
    Ask me about my bottom br FaultyMario's Avatar
    Join Date
    Jan 2014
    Location
    ox.mx
    Posts
    8,460
    Gotcha.

    run o-help for a list of available commands
    C:\Program Files\QGIS 3.34.6>py
    Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> print('\n'.join(sys.path))

    C:\Users\ciber\AppData\Local\Programs\Python\Pytho n312\python312.zip
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\DLLs
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib
    C:\Users\ciber\AppData\Local\Programs\Python\Pytho n312
    C:\Users\ciber\AppData\Roaming\Python\Python312\si te-packages
    C:\PROGRA~1\QGIS33~1.6\apps\Python312
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\win32
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\win32\lib
    C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\Pythonwin
    >>>
    acket.

  9. #39
    Administrator
    Join Date
    Jan 2014
    Posts
    9,105
    Okay, that seems reasonable I think. Running in that same OSGeo4W.bat command prompt, run "pip install pysal" and hopefully that'll get you there.

  10. #40
    Ask me about my bottom br FaultyMario's Avatar
    Join Date
    Jan 2014
    Location
    ox.mx
    Posts
    8,460
    OK. I did and when I called up the python prompt in QGIS and imported numpy, scipy and pysal I got no error messages.

    So, if i understand this correctly, i should now be able to edit a script in the little python box with anything on this lib, right?
    acket.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •