hrsgn edited a comment on issue #3600: URL: https://github.com/apache/incubator-heron/issues/3600#issuecomment-671078599
> _**TL;DR:** your python3 binary is probably called `python` or `python3`, but PEX by default needs `python<major>.<minor>` where the major and minor version are the same as those used to build the PEX_ > > _**edit:** humm, your `./baze_configure.py` dump shows you do have a `python<major>.<minor>` - for some reason that isn't visible in the environment the PEX is being executed - is it a separate environment?_ > > one thing with PEX is that it tries to be explicit about what version of python it is for by default (you could argue it's good for reproducibility, but a pain for flexibility), so if you run code on a python3.6 interpreter, it will automatically make it so the generated PEX starts with `#!/usr/bin/env python3.6`, rather than more generic shebang lines calling `python3` or `python`. > > It seems you don't have a `python3.6` file on your system `$PATH`, which you'll need to stop that _"No such file or directory"_. Centos may have a package or option to install the more explicit `pythonX.Y` link, or you may have to symlink or hardlink it yourself. > > p.s. yep, 3.6 is what is tested in CI and the minimum compatible version, but there's a decent chance that later versions also work - I can confirm that the build and tests work with python3.8 as that is what ends up used if you run [`./vagrant/local-ci.sh`](https://github.com/apache/incubator-heron/blob/master/vagrant/local-ci.sh) (which does the same process as Travis CI). @Code0x58 I’m sorry, I still haven’t found the reason. I haven’t used python before and don’t know much about python. [zw@centos01 incubator-heron]$ **bazel build --config=centos heron/...** WARNING: /home/zw/incubator-heron/heron/healthmgr/tests/java/BUILD:52:13: in srcs attribute of java_library rule //heron/healthmgr/tests/java:healthmgr-tests: please do not import '//heron/healthmgr/src/java:org/apache/heron/healthmgr/HealthManager.java' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'java_library', the error might have been caused by the macro implementation INFO: Analyzed 612 targets (0 packages loaded, 0 targets configured). INFO: Found 612 targets... **ERROR: /home/zw/incubator-heron/third_party/python/cpplint/BUILD:5:11: PexPython third_party/python/cpplint/cpplint.pex failed (Exit 127) /usr/bin/env: python3.6: No such file or directory** INFO: Elapsed time: 1.696s, Critical Path: 0.04s INFO: 0 processes. FAILED: Build did NOT complete successfully [zw@centos01 incubator-heron]$ **ls -l /usr/bin/python*** lrwxrwxrwx. 1 root root 32 8月 7 16:47 /usr/bin/python -> /usr/local/python3.6/bin/python3 lrwxrwxrwx. 1 root root 9 8月 5 00:27 /usr/bin/python2 -> python2.7 -rwxr-xr-x. 1 root root 7144 4月 2 21:17 /usr/bin/python2.7 lrwxrwxrwx. 1 root root 32 8月 10 00:41 /usr/bin/python3 -> /usr/local/python3.6/bin/python3 [zw@centos01 bin]$ **echo $PATH** /usr/local/ant/apache-ant-1.10.8/bin:**/usr/local/python3.6/bin**:/usr/local/java/jdk1.8.0_151/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/zw/.local/bin:/home/zw/bin [zw@centos01 incubator-heron]$ **cd /usr/local/python3.6/bin/ && ll** 总用量 24864 lrwxrwxrwx. 1 root root 8 8月 7 16:34 2to3 -> 2to3-3.6 -rwxr-xr-x. 1 root root 111 8月 7 16:34 2to3-3.6 -rwxr-xr-x. 1 root root 252 8月 7 16:34 easy_install-3.6 lrwxrwxrwx. 1 root root 7 8月 7 16:34 idle3 -> idle3.6 -rwxr-xr-x. 1 root root 109 8月 7 16:34 idle3.6 -rwxr-xr-x. 1 root root 234 8月 7 16:34 pip3 -rwxr-xr-x. 1 root root 234 8月 7 16:34 pip3.6 lrwxrwxrwx. 1 root root 8 8月 7 16:34 pydoc3 -> pydoc3.6 -rwxr-xr-x. 1 root root 94 8月 7 16:34 pydoc3.6 lrwxrwxrwx. 1 root root 9 8月 7 16:34 python3 -> python3.6 -rwxr-xr-x. 2 root root 12710008 8月 7 16:33 python3.6 lrwxrwxrwx. 1 root root 17 8月 7 16:34 python3.6-config -> python3.6m-config -rwxr-xr-x. 2 root root 12710008 8月 7 16:33 python3.6m -rwxr-xr-x. 1 root root 3107 8月 7 16:34 python3.6m-config lrwxrwxrwx. 1 root root 16 8月 7 16:34 python3-config -> python3.6-config lrwxrwxrwx. 1 root root 10 8月 7 16:34 pyvenv -> pyvenv-3.6 -rwxr-xr-x. 1 root root 451 8月 7 16:34 pyvenv-3.6 [zw@centos01 bin]$ **python3** Python 3.6.11 (default, Aug 7 2020, 16:32:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> [zw@centos01 bin]$ **more** /home/zw/incubator-heron/third_party/python/cpplint/**cpplint.py** #!/usr/bin/env python3 # ... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
