Ubuntu - package installer not working

Issue #390 closed
Fabian Thiel created an issue

/usr/bin/python -m pip install --user scipy>=1.1

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user scipy>=1.1': '/usr/bin/python -m pip install --user scipy>=1.1'

/usr/bin/python -m pip install --user scikit-learn>=0.19.2

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user scikit-learn>=0.19.2': '/usr/bin/python -m pip install --user scikit-learn>=0.19.2'

/usr/bin/python -m pip install --user astropy

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user astropy': '/usr/bin/python -m pip install --user astropy'

/usr/bin/python -m pip install --user pyopengl

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user pyopengl': '/usr/bin/python -m pip install --user pyopengl'

/usr/bin/python -m pip install --user numba

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user numba': '/usr/bin/python -m pip install --user numba'

/usr/bin/python -m pip install --user netCDF4

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user netCDF4': '/usr/bin/python -m pip install --user netCDF4'

/usr/bin/python -m pip install --user enpt-enmapboxapp

[Errno 2] No such file or directory: '/usr/bin/python -m pip install --user enpt-enmapboxapp': '/usr/bin/python -m pip install --user enpt-enmapboxapp'

Version 3.6.20200327T152216.develop

Comments (9)

  1. Fabian Thiel reporter

    Maybe explicitly call python3?

    QGIS console:

    print(sys.executable)
    /usr/bin/python3
    

  2. Benjamin Jakimow

    the problem is that this won’t work for windows OSGeo4W QGIS, where sys.executable returns the QGIS executable, not that for python.

    What return the following function in your Ubuntu QGIS, @Fabian Thiel ?

    import shutil, pathlib, os
    from difflib import SequenceMatcher
    
    def localPythonExecutable() -> pathlib.Path:
        """
        Searches for the local python executable
        :return:
        """
    
        candidates = [sys.executable,
                      shutil.which('python3'),
                      shutil.which('python')]
    
        candidates = [c for c in candidates if isinstance(c, str) and len(c) > 0]
    
        r = os.path.dirname(os.__file__)
        similarity = [SequenceMatcher(None, r, c).ratio() for c in candidates]
    
        pyexe = candidates[similarity.index(max(similarity))]
        return pathlib.Path(pyexe)
    

  3. Log in to comment