question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buck requires python 2.7

See original GitHub issue

So 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yidingcommented, Jun 15, 2017

Fixed in b2af4022fe7168a4a31571a771ebda426af702eb.

0reactions
hey99xxcommented, Jun 14, 2017

@yiding sorry if I misunderstood command’s explanation from a coworker. It may be using PATH which is fine. But the thing is buck would choose python 2.6 regardless. On my system:

$ command -v python2 python
/usr/bin/python2
/mycustomlocation/python

$ /usr/bin/python2 --version
Python 2.6.9

$ /mycustomlocation/python --version
Python 2.7.8

which means PYTHON=$(command -v python2 python | head -1) will always be Python 2.6, unless I hack around my system and create a python2 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 as PYTHON=$(command -v python | head -1) so I can keep building my dependent projects.

Thanks for the quick look at this issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found