Git Product home page Git Product logo

Comments (5)

jonathan-neufeld-asurion avatar jonathan-neufeld-asurion commented on May 31, 2024 2

I am running into this issue now as well, and to answer your question, they are very different.

I found the issue, an older version of argparse was installed as a standalone module and it was overriding with the built-in version.

from yq.

kislyuk avatar kislyuk commented on May 31, 2024

Thanks for reporting.

It looks like perhaps your argparse library is from an older version of Python. How did you install yq?

Can you paste the output of the following commands:

echo $PYTHONPATH
cat /usr/bin/yq

Then, using the path to Python that appears in the first line of that output (for example, in my case it's #!/usr/local/opt/python/bin/python3.6):

/usr/local/opt/python/bin/python3.6 --version
/usr/local/opt/python/bin/python3.6 -c 'import argparse; print(argparse.__file__)'

The argument allow_abbrev was introduced in Python 3.5: https://docs.python.org/3/library/argparse.html#allow-abbrev. yq tests the version of Python before passing the argument, and only does so if the version is 3.5 or above.

from yq.

gdmsl avatar gdmsl commented on May 31, 2024

So I have this lines in my .profile.

# python path
export PYTHONUSERBASE="$HOME/Variable/python3"
export PYTHONPATH="$PYTHONUSERBASE/lib/python3.7/site-packages:$PYTHONPATH"
export PATH="$PYTHONUSERBASE/bin:$PATH"

which lead to the following python path

$ echo $PYTHONPATH
/home/gdmsl/Variable/python3/lib/python3.7/site-packages:

I installed yq from AUR (Archlinux)

$ which yq
/usr/bin/yq

$ head /usr/bin/yq
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'yq==2.7.1','console_scripts','yq'
__requires__ = 'yq==2.7.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('yq==2.7.1', 'console_scripts', 'yq')()
    )

then

$ python --version
Python 3.7.2

and finally

$ python -c 'import argparse; print(argparse.__file__)'
/usr/lib/python3.7/argparse.py

from yq.

kislyuk avatar kislyuk commented on May 31, 2024

Can you check that the file in /usr/lib/python3.7/argparse.py is identical to https://github.com/python/cpython/blob/3.7/Lib/argparse.py?

from yq.

kislyuk avatar kislyuk commented on May 31, 2024

Closing due to lack of response.

from yq.

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.