-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set #9436
Comments
Also (unrelated), the bash tools/tf_env_collect.sh
Collecting system information...
cat: /proc/1/cgroup: No such file or directory
tools/tf_env_collect.sh: line 31: syntax error near unexpected token `>'
tools/tf_env_collect.sh: line 31: `c++ --version &>> $OUTPUT_FILE' |
Did you run |
@girving I had the same error when I'm build tensorflow-serving.And I've configured the tensorflow alreay. |
@caisq Is |
cc @aselle (author) for whether |
I am getting the same error trying to run command 'bazel build --config opt tensorflow/examples/image_retraining:retrain' Error: 'PYTHON_BIN_PATH' environment variable is not set and referenced by '//util/python:python_headers'. |
I think this is a recent problem with the current master's source codes. I tested the compilation of Tensorflow serving both locally and in docker. Both environments gave me the same error "Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set". Of course, I set the configure before the build. In fact, I was able to successfully compile Tensorflow under the same environment with the same configuration a few weeks ago and there was no problem. So this must be a recent issue. The full error message is: Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set` |
@jart Do you know what the issue might be? |
I just ran into this issue as well. I am compiling in an Ubuntu 14.04 Docker container (using the standard Dockerfile.devel image). |
Just want to make people aware of that you don't need to wait for this to be solved if you don't necessarily need to work with the latest RC version. I have just tested it with Tensorflow serving, and it works with its latest release (tag 0.5.1). You can simply clone that tag by running. |
Adding to @shadowfury330's point, if you have TF Serving source checked out at
You should then be able to run bazel successfully. |
@girving : Turns out I forgot to run |
In order to solve it, you could simply try to export the variable it needed before the build with: |
@hantingxie I have the same problem, but I'm building tensorflow-serving using standard Dockerfile.devel image as @neocortical did. So it might not be specifically only Anaconda related problem. Also, it worked for me just couple weeks before with the same configuration. |
@MtDersvan Good to hear that you solved it. I agree with you, this issue might be caused by several different reasons. Anaconda can be one of them. |
Hi, it seems to be working fine for me with @hantingxie 's solution. For some reason desipte ./configure recognizing my default path I still had to manually set my PYTHON_BIN_PATH. And yes, this is happening in the default dockerfile that's mentioned in the tensorflow serving docs. |
There's a possibility this is a bug upstream in Bazel. Maybe |
@nlopezgi should know about this issue. |
- Remove experimental attributes (local_checks, python_include, numpy_include, remote_config_repo). Use of experimental remote repo can only be enabled now via env variable (preferred to change to workspace file) - Fix hardcoded fallback value for python bin. New fallback is to use 'which python' and fail if python not set in path (solves tensorflow#9436 / works around bazelbuild/bazel#3057). - Fixes minor issues with template: adds spaces to srcs in genrule, remove extra space after genrules. - Some dead code clean up (use of empty configuration) PiperOrigin-RevId: 160594421
For anyone who's still getting this error: |
Might be unrelated for many, but this is how I circumvented the error. I am installing in a virtual env. I installed the virtualenv library in python3.5. Upon making the env, I point to the binaries for python3.6. This gives me the error. Now I solved the problem as follows. I install virtualenv for python3.6 and use that to make an env. In this env, this above error does not occur. |
I solve the same problem by adding the PYTHON_BIN_PATH to " ~/.bash_profile ". If you don't have a Environment Parameter named PYTHON_BIN_PATH, the error msg will be ['PYTHON_BIN_PATH' environment variable is not set], if you already have one but not correct, the error msg would be [ PYTHON_BIN_PATH is not executable ]. Note that the PYTHON_BIN_PATH should specify to ".../bin/python" instead of ".../bin ", the latter would raise the [ not executable ] error. |
Since #14467 it is again required to have the env variable PYTHON_BIN_PATH explicitly set, run configure script to set it, or to set it via --action_env. |
yeah, you are right. I'v found that later. If run configure, both problem I
mentioned above should not happen.
2017-12-05 23:31 GMT+08:00 Nicolas Lopez <notifications@github.com>:
… Since #14467 <#14467> it is
again required to have the env variable PYTHON_BIN_PATH explicitly set, run
configure script to set it, or to set it via --action_env.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9436 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ASdZr8UEiLTohC88z7iyqVOrxAQYPADYks5s9WG7gaJpZM4NHX2y>
.
|
I have the same issue, none of the above solution worked for me. I'm getting the following error in Windows 10 x64:
I thought it must be an OS issue, I tried on Ubuntu 18.04 LTS (Windows Subsystem). Then I got the same error with
Yes, Python is installed correctly and I can use it with python3 on CMD as well as terminal. I tried to define the |
@mirwisek, or anyone else on this thread, which parts of tensorflow do you intend to use? There might be a docker container available for your use case. My original interest in tensorflow was syntaxnet, for which I found and subsequently forked a more user friendly version of the syntaxnet container. Point is, the containers are much more reliable than building and running the source. |
- Remove experimental attributes (local_checks, python_include, numpy_include, remote_config_repo). Use of experimental remote repo can only be enabled now via env variable (preferred to change to workspace file) - Fix hardcoded fallback value for python bin. New fallback is to use 'which python' and fail if python not set in path (solves tensorflow/tensorflow#9436 / works around bazelbuild/bazel#3057). - Fixes minor issues with template: adds spaces to srcs in genrule, remove extra space after genrules. - Some dead code clean up (use of empty configuration) PiperOrigin-RevId: 160594421
System information
sudo bazel build --config opt --copt=-msse4.1 --copt=-msse4.1 --copt=-mavx --copt=-mavx2 --copt=-mfma //tensorflow/tools/pip_package:build_pip_package
Describe the problem
Trying to build tensorflow from source (version installed via pip does not use some optimised CPU instructions), get the following error:
Note that I used
which python3
to find where my Python binary is located, and exported that as PYTHON_BIN_PATH, but it does not seem to help.The text was updated successfully, but these errors were encountered: