Comments (5)
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.
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.
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.
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.
Closing due to lack of response.
from yq.
Related Issues (20)
- A scalar starting with 00 (double zero) is interpreted as octal number HOT 2
- Use python built in TOML support? HOT 4
- [xq] Parse optional schema (xsd) file to determine the types for better json output HOT 1
- Array indexing diverges from jq syntax HOT 3
- Some advice about license compliance HOT 1
- Parsing nmap's XML: single script node into object, multiple script nodes into array HOT 4
- add `fromyaml` like jqs `fromjson` HOT 3
- tomlq throws TypeError on documents containing date-time values HOT 1
- test output too noisy HOT 1
- order of parameters changes behavior HOT 1
- Add indentation & improve sorting of TOML output HOT 4
- Python 3.6 installation from PyPI broken HOT 4
- XML streaming mode HOT 2
- ConstructorError: found unconstructable recursive node HOT 2
- Tests fail with a variety of errors: argparse.ArgumentError: argument files: can't open '/dev/fd/3': [Errno 2] No such file or directory: '/dev/fd/3', etc HOT 1
- xml: is keeping the namespace possible? HOT 1
- Test fails with jq-1.7 HOT 1
- Ubuntu 23.04 disallows `pip install yq` by default HOT 2
- output string '08' and '09' without quote using yaml output format HOT 1
- xq no longer outputting JSON HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yq.