-
Notifications
You must be signed in to change notification settings - Fork 821
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
jinja2: no filter named to json #649
Comments
@LovelyBuggies |
Yeah, I tried, the fact is that I had jinja2==2.11.2 installed, but got $ bash tools/bazel-build-standalone-lib.sh [-abi=abi][-runtimes=rt1,rt2,...][-static]
build shared lib for armeabi-v7a + cpu_gpu_dsp
Starting local Bazel server and connecting to it...
...........
write version v0.13.0-0-g9a06864 to /home/parallels/.cache/bazel/_bazel_parallels/5ff1ff2df121917af4fe9fa25c7709ef/external/local_version_config/gen/version
Traceback (most recent call last):
File "/home/parallels/.cache/bazel/_bazel_parallels/5ff1ff2df121917af4fe9fa25c7709ef/external/mace//mace/python/tools/encrypt_opencl_codegen.py", line 20, in <module>
import jinja2
ImportError: No module named jinja2
ERROR: /home/parallels/mace/mace/codegen/BUILD.bazel:26:1: no such target '@local_opencl_kernel_encrypt//:gen/encrypt_opencl_kernel.cc': target 'gen/encrypt_opencl_kernel.cc' not declared in package '' defined by /home/parallels/.cache/bazel/_bazel_parallels/5ff1ff2df121917af4fe9fa25c7709ef/external/local_opencl_kernel_encrypt/BUILD.bazel and referenced by '//mace/codegen:encrypt_opencl_kernel_gen'
ERROR: /home/parallels/mace/mace/codegen/BUILD.bazel:26:1: no such target '@local_opencl_kernel_encrypt//:gen/encrypt_opencl_kernel.h': target 'gen/encrypt_opencl_kernel.h' not declared in package '' defined by /home/parallels/.cache/bazel/_bazel_parallels/5ff1ff2df121917af4fe9fa25c7709ef/external/local_opencl_kernel_encrypt/BUILD.bazel and referenced by '//mace/codegen:encrypt_opencl_kernel_gen'
ERROR: Analysis of target '//mace/libmace:libmace_dynamic' failed; build aborted: Loading failed
INFO: Elapsed time: 6.132s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (33 packages loaded)
$ pip3 show jinja2
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Name: Jinja2
Version: 2.11.2
Summary: A very fast and expressive template engine.
Home-page: https://palletsprojects.com/p/jinja/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/parallels/.local/lib/python3.5/site-packages
Requires: MarkupSafe
Required-by: See, there is jinja2==2.11.2 in my pip3, but not sure why jinja2 is not found when building mace lib /confused. |
If I used the method at #620 (comment), i.e., using apt-get to install, the error More clues: apt-get install with upgrade option can only get 2.8.1 python-jinja2. sudo apt-get install -y python-jinja2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
aptitude-common libcwidget3v5 libpython-all-dev libpython-dev
libpython2.7-dev python-all python-all-dev python-dev python-wheel
python2.7-dev
Use 'sudo apt autoremove' to remove them.
Suggested packages:
python-jinja2-doc
The following NEW packages will be installed:
python-jinja2
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 0 B/106 kB of archives.
After this operation, 843 kB of additional disk space will be used.
Selecting previously unselected package python-jinja2.
(Reading database ... 176645 files and directories currently installed.)
Preparing to unpack .../python-jinja2_2.8-1ubuntu0.1_all.deb ...
Unpacking python-jinja2 (2.8-1ubuntu0.1) ...
Setting up python-jinja2 (2.8-1ubuntu0.1) ... |
What's the output of |
$ python --version
Python 2.7.12
$ python3 --version
Python 3.5.2 P.S. I am not using python2. |
How do you ensure bazel use python3? |
I cannot ensure, actually. Let me try 3.6+ and remove python2 :) |
Before you open an issue, please make sure you have tried the following steps:
System information
Describe the problem
no filter named to json
when building standalone. I tried the method in #620's #620 (comment). Butapt-get install python3-jinja2
==2.8.1 automatically, which will generate the problemjinja2.exceptions.TemplateAssertionError: no filter named 'tojson'
.P.S. A possible solution would be to upgrade jinja2 simonw/datasette#100 (comment), but not sure how to do it (
apt-get upgrade python-jinja2
would always give me a 2.8.0). PyPI can get jinja2 2.11.0, but is of no use as mentioned above. Btw, aptitude gives me 2.8.0, too.😣To Reproduce
Steps to reproduce the problem:
Error information / logs
Please include the full log and/or traceback here.
The text was updated successfully, but these errors were encountered: