Giter VIP home page Giter VIP logo

Comments (4)

atc0005 avatar atc0005 commented on August 19, 2024 2

@chrisdamato I ran into this today. The culprit ended up being a /usr/bin/six.pyc file. This seems to have been created by the VMware Perl SDK installation process. Go figure.

Once I removed that file, the error went away.

from six.

hroncok avatar hroncok commented on August 19, 2024 2

When you run e.g. dnf or any other commend that is written in Python and installed in /usr/bin, Python adds /usr/bin as sys.path[0]. When a file called six.pyc exists in there, it is imported instead of six and the import fails.

We (Fedora) would like to start using a flag in shebang lines of Python scripts installed in /usr/bin that would prevent this undesired behavior, but such flag does not exist yet (-I does that, but it also does other things). I've asked for such flag many winters ago in https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235

from six.

hroncok avatar hroncok commented on August 19, 2024

I've opened rpm-software-management/dnf#1815 for dnf specifically, but this can happen to any Python script residing in a directory like /usr/bin.

from six.

hroncok avatar hroncok commented on August 19, 2024

I've also opened https://discuss.python.org/t/should-console-scripts-entry-points-exclude-the-scripts-directory-from-sys-path/13896 for console_scripts entry points (which dnf is not)

from six.

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.