MolBERT
MolBERT copied to clipboard
pip install does not include utils/data directory
Description
The project does not include a MANIFEST.in file, which causes pip install .
to not include the utils/data/elements.txt
in the install directory.
This causes an FileNotFoundError: [Errno 2] File /opt/conda/envs/api/lib/python3.7/site-packages/molbert/utils/featurizer/../data/elements.txt does not exist: '/opt/conda/envs/api/lib/python3.7/site-packages/molbert/utils/featurizer/../data/elements.txt'
error when using the MolBertFeaturizer
.
Solution
Add a MANIFEST.in file with the following entry:
recursive-include molbert/utils/data *
Hey, thanks for raising the issue. Could you add more details so that I can reproduce this? I was able to run scripts/featurize.py
with the pre-trained model on a completely new installation (following the README) without any issues. Cheers, Beni
Hi Beni, I found the issue when installing it via pip in a docker container. What happens is that pip clones the repository and executes the install (via the setup.py). The cloned repository is discarded, only the installed source survives in the install path (/opt/conda/envs/api/lib/python3.7/site-packages/molbert
for example). But because the assets are not included in the MANIFEST, they are not copied to this directory.
You can check this by installing it via
pip install git+https://github.com/BenevolentAI/MolBERT.git
and then check the install path, you will see that it doesn't include the required assets (or it does and I messed up 😅).
Let me know if you need anything else, and thanks for the response!
Best,
Michael