You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experimenting with Bazel + PIP rules in my Python project that used Python 3.
My default interpreter was Python 2 when I first created my Bazel project with all PIP dependencies in it.
I tried running some unit-tests with Bazel and got errors about running in Python 2.
Changed test's python_version to PY3 and got errors about fetched PIP dependencies working only with Python 2, not 3. It was an error somewhere in a recursive dependency (Python 2's future library, in particular).
I tried to make rules_python to work with a different interpreter, and it didn't work. It was easier to change my default Python interpreter to Python 3.
After doing that, the dependencies were not downloaded again to work with Python 3. I tried calling bazel clean multiple times, that didn't work. It was hard for me to debug the problem. I spent several hours doing that as I didn't have a lot of experience with Bazel.
In order to make it work, I had to call bazel clean --expunge.
I wish it was documented somewhere. It would have saved me several hours of debugging. If you consider to merge one of the PRs: #85 or #158, then it will also be a problem using the functionality.
Anyway, thank you for the project. This is not really a huge problem. The issue is here to make it easier for someone else online in the future.
The text was updated successfully, but these errors were encountered:
brandjon
changed the title
Weird behaviour when changing default Python interpreter from 2 to 3
Document how to flush out bad pip deps with bazel clean --expunge
Nov 12, 2019
Hello. Thank you very much for your work.
I was experimenting with Bazel + PIP rules in my Python project that used Python 3.
My default interpreter was Python 2 when I first created my Bazel project with all PIP dependencies in it.
I tried running some unit-tests with Bazel and got errors about running in Python 2.
Changed test's
python_version
to PY3 and got errors about fetched PIP dependencies working only with Python 2, not 3. It was an error somewhere in a recursive dependency (Python 2'sfuture
library, in particular).I tried to make
rules_python
to work with a different interpreter, and it didn't work. It was easier to change my default Python interpreter to Python 3.After doing that, the dependencies were not downloaded again to work with Python 3. I tried calling
bazel clean
multiple times, that didn't work. It was hard for me to debug the problem. I spent several hours doing that as I didn't have a lot of experience with Bazel.In order to make it work, I had to call
bazel clean --expunge
.I wish it was documented somewhere. It would have saved me several hours of debugging. If you consider to merge one of the PRs: #85 or #158, then it will also be a problem using the functionality.
Anyway, thank you for the project. This is not really a huge problem. The issue is here to make it easier for someone else online in the future.
The text was updated successfully, but these errors were encountered: