-
Notifications
You must be signed in to change notification settings - Fork 69
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
Error: "No module named 'markupsafe'" from py_gapic_library rule #361
Comments
@vam-google, is this something that you are looking at? Please advice. |
@aohren @hkdevandla Yes, please add all missing modules to In bazel python rules are "semi-hermetic", unfortunately. What that means is if bazel rules specify explicit dependency on a python module, then exactly this module of exactly this version will be pulled and used by bazel. But if the module was not specified explicitly, but is installed on the executing machine, the build will pull whatever was installed on the machine. This makes it hard to detect the full list of dependencies. @aohren I believe it will be not the only missing module. Please keep installing them and keep notest of what you had to install, once it stops complaining about missing modules. |
Sounds good. Thanks @vam-google. @aohren , please let us know if you have questions. |
@vam-google Understood, I did try locally installing the markupsafe package on my build machine, but that didn't seem to resolve the error. I can keep digging into it, but would there be anything else required to get the Bazel to see the module installed on the executing machine? |
I've also tried cloning gapic-generator-python project locally, pointing my WORKSPACE to it via local_repository instead of GitHub, and adding markupsafe==1.1.1 to the requirements.txt. Still getting the |
@aohren Sorry, I forgot to mention that each dependency must be added in two places: On my machine the dependency is called 'MarkupSafe' (capital M and S), so it should be something like When you install modules on your machine's python, please make sure that they are installed for the proper version of python (the one used by bazel, which is most probably the latest version of Python on your machine). Please let me know if that works for you (I was able to reproduce the issue by removing the module from my machine and then "fix" it by putting the module in the two files). |
@aohren Hi, Adam, did you have a chance to check if the suggested solution works for you? |
Ah yes, thanks. Adding the analogous line in BUILD.bazel fixed the issue. One thing to note in general is that |
Yes, I noticed that too. It is not always the case (sometimes it is fast). It is weird and should not take that much time. This dependency pulling is done by rules_python library we depend on (collection of generic python rules). I honestly don't know what is going on here =(. We need to ask the python rules maintainers. |
From what I can tell, when it's stuck waiting for the ~5 mins, there are many compiler and assembler processes running in the background (e.g., I can reproduce this consistently by doing a |
@aohren Just released 0.21.1 with your PR. Closing the issue. |
It seems only one of the issues mentioned is solved, reopening the issue. |
Created issue #400 to address the second concern, as it's a separate issue. We can close this item out. |
I'm experimenting with the new
py_gapic_library
rule and get the following error about missingmarkupsafe
module. Do we need it added torequirements.txt
?The text was updated successfully, but these errors were encountered: