8000 Fix for import_submodules by matt-gardner · Pull Request #1976 · allenai/allennlp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Fix for import_submodules #1976

Merged
merged 3 commits into from
Oct 26, 2018

Conversation

matt-gardner
Copy link
Contributor
@matt-gardner matt-gardner commented Oct 26, 2018

I'm really not sure what circumstance led me to run into this, but this change fixed the problem. I don't understand why others haven't run into this issue; maybe it's because I was using allennlp just in my PYTHONPATH, instead of installing it through pip?

The exact command I was running was:

PYTHONPATH=~/clone/allennlp:. python ~/clone/allennlp/allennlp/run.py train training_config/latent_alignment.json -s /tmp/align -f --include-package weak_supervision

8000
@matt-gardner matt-gardner requested a review from joelgrus October 26, 2018 19:11
for module_finder, name, _ in pkgutil.walk_packages(path):
# Sometimes when you import third-party libraries that are on your path,
# `pkgutil.walk_packages` returns those too, so we need to skip them.
if path_string and module_finder.path not in path_string:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reasoning for the in instead of ==?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me doing a cursory look at the strings and not realizing they were equal instead of a substring... =)

@matt-gardner matt-gardner merged commit 5aa1c8f into allenai:master Oct 26, 2018
@matt-gardner matt-gardner deleted the import_submodule_fix branch October 26, 2018 21:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0