Giter Club home page Giter Club logo

Comments (3)

green-green-avk avatar green-green-avk commented on June 20, 2024 1

Unsetting ANDROID_DATA or ANDROID_ROOT environment variables is a way more convenient. The mentioned type of vandalizing things is not necessary here at all.

from anotherterm.

green-green-avk avatar green-green-avk commented on June 20, 2024

Uh, huh...

The problem

/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/__init__.py:

In Debian Bookworm (pip3 v23.0.1):

def _set_platform_dir_class() -> type[PlatformDirsABC]:
    if sys.platform == "win32":
        from pip._vendor.platformdirs.windows import Windows as Result
    elif sys.platform == "darwin":
        from pip._vendor.platformdirs.macos import MacOS as Result
    else:
        from pip._vendor.platformdirs.unix import Unix as Result

    if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system":

        if os.getenv("SHELL") or os.getenv("PREFIX"):
            return Result

        from pip._vendor.platformdirs.android import _android_folder

        if _android_folder() is not None:
            from pip._vendor.platformdirs.android import Android

            return Android  # return to avoid redefinition of result

    return Result

In Ubuntu Jammy (pip3 v22.0.2):

def _set_platform_dir_class() -> type[PlatformDirsABC]:
    if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system":
        module, name = "pip._vendor.platformdirs.android", "Android"
    elif sys.platform == "win32":
        module, name = "pip._vendor.platformdirs.windows", "Windows"
    elif sys.platform == "darwin":
        module, name = "pip._vendor.platformdirs.macos", "MacOS"
    else:
        module, name = "pip._vendor.platformdirs.unix", "Unix"
    result: type[PlatformDirsABC] = getattr(importlib.import_module(module), name)
    return result

The solution

Just unset any of the ANDROID_DATA or ANDROID_ROOT environment variables and proceed.

from anotherterm.

BDhackers009 avatar BDhackers009 commented on June 20, 2024

You can use this script...to fix the issue

https://github.com/BDhackers009/fixpip3

from anotherterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.