Buck requires python 2.7
See original GitHub issueSo although it’s advertised as buck supporting python 2.6 and 2.7, I’ve just found out it’s not the case.
In https://github.com/facebook/buck/blob/master/programs/buck_repo.py#L10 you’re using
from subprocess import check_output
which is not available in 2.6. So I am ok using 2.7 for python. But the issue is that I cannot force buck to pick up Python 2.7 from my system. Buck’s bin file is written in a way that makes it impossible https://github.com/facebook/buck/blob/master/bin/buck#L21
PYTHON=$(command -v python2 python | head -1)
On my system python2 is of version 2.6 coming from /usr/bin/python2, and python is of version 2.7 coming from a custom installed location. But you’re using command
which skips over my PATH and chooses first python2, which is 2.6 and now my builds are broken with
~/Desktop/downloads/buck $ ./bin/buck --help
Traceback (most recent call last):
File "/local/home/user/Desktop/downloads/buck/bin/../programs/buck.py", line 48, in <module>
propagate_failure(main(sys.argv))
File "/local/home/user/Desktop/downloads/buck/bin/../programs/buck.py", line 36, in main
with get_repo(project) as buck_repo:
File "/local/home/user/Desktop/downloads/buck/bin/../programs/buck.py", line 25, in get_repo
from buck_repo import BuckRepo
File "/local/home/user/Desktop/downloads/buck/programs/buck_repo.py", line 10, in <module>
from subprocess import check_output
ImportError: cannot import name check_output
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Getting Started - Buck
Buck currently requires Java 8; we are working toward support for future versions. If you have multiple installations of Java on your development...
Read more >Gerrit Code Review - Building with Buck
Buck requires Python version 2.7 to be installed. The Maven download toolchain requires curl to be installed. Eclipse Integration. Generating the Eclipse ...
Read more >Dropping support for older Python versions
Dropping support for older Python versions is supported by the standard Core metadata specifications 1.2 specification via a “Requires-Python” attribute.
Read more >Update PyDev project to use Python 2.7 · e1950a67eb - gerrit ...
Buck now requires Python 2.7, so update the project accordingly. Change-Id: I5e401b00e9ac80eab3008ced0f632f7d4065fcbf changes/10/236010/1.
Read more >docs/setup/install.soy - buck - Git at Google
{call buck.platformWarning /}. Buck requires that the following tools are already installed: <ul>. <li>Oracle JDK 7. <li>Ant. <li>Python 2.7. <li>Git.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in b2af4022fe7168a4a31571a771ebda426af702eb.
@yiding sorry if I misunderstood
command
’s explanation from a coworker. It may be usingPATH
which is fine. But the thing is buck would choose python 2.6 regardless. On my system:which means
PYTHON=$(command -v python2 python | head -1)
will always be Python 2.6, unless I hack around my system and create apython2
symlink and point it to 2.7. But Python 2.6 came out of the box in my Linux, so I’m hesitant to modify my path to use Buck. As a temporary workaround, I’ve rewritten that line asPYTHON=$(command -v python | head -1)
so I can keep building my dependent projects.Thanks for the quick look at this issue.