Ad
Bzr Not Being Able To Use The Right Python Version In Msys2
I am using Msys2 from PortableApps under Win10.
I cannot run bzr
. I am adding below the output of a few command that illustrate the issue, and provide information that can guide the answer:
$ bzr
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
$ type bzr
bzr is hashed (/usr/bin/bzr)
$ python2 /usr/bin/bzr
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
$ python2 -m trace --count /usr/bin/bzr
File "/c/Users/ry16205/Documents/appls_mydocs/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site.py", line 177
file=sys.stderr)
^
SyntaxError: invalid syntax
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:...
$ type python
python is hashed (/usr/bin/python)
$ type python2
python2 is hashed (/usr/bin/python2)
$ head -1 /usr/bin/bzr
#!/usr/bin/python2
$ python --version
Python 3.7.4
$ echo $PYTHONPATH
/c/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7:/c/PortableApps/MSYS2Portable/App/msys32/mingw64/lib/python3.7/site-packages
My main question is:
How can I execute bzr
commands, without radically changing my configuration / removing python3?
In addition, I wonder why the trace
did not show more info than it did.
Ad
Answer
This appears to be happening because your PYTHONPATH is pointing at a Python3-specific path, and it contains python files that Python 2 can not parse.
Unsetting PYTHONPATH, either permanently or just for bzr, should resolve the issue:
$ PYTHONPATH= bzr rocks
Ad
source: stackoverflow.com
Related Questions
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Can't turn off Javascript using Selenium
- → WebDriver click() vs JavaScript click()
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module
Ad