emanjavacas / pie

A fully-fledge PyTorch package for Morphological Analysis, tailored to morphologically rich and historical languages.
MIT License
22 stars 10 forks source link

spurious git error when imported #41

Open bnagy opened 4 years ago

bnagy commented 4 years ago

Hi,

When I (or another package) import this package, there is something trying to run a git command. I get:

fatal: not a git repository (or any of the parent directories): .git

I tried to git clone it to play around and find the bug but it doesn't seem to install cleanly from the git image, and in any case, that would mask the bug (because probably the command would be running in a git repo)

Steps to repro:

python -m venv test
pip install nlp-pie
python -c "import pie"

I'm on OSX Mojave, Python 3.7

emanjavacas commented 4 years ago

Hey,

Thanks for the report. There is some code that makes sure to store the version of pie that are installing during setup. We record the commit version of the package when it was compiled to rule out package version issues when loading models trained with a different version. It's just a safety check. If you install it from the pypi servers, you shouldn't see any of this. You might be in the downloaded pie folder when trying to import after having installed it from pypi, and then it's trying to import the one from that folder and not the pip-installed one. If you build it yourself, just make sure to clone it instead of just downloading the zip folder. In that case you shouldn't see the message. In any case, you should be fine ignoring the warning.

Let me know if this helps. I'd be happy to look into it in more detail.

bnagy commented 4 years ago

Thanks for the reply! :)

I did install from the pypi servers. I'm not in the pie directory when I receive the error. When I cloned the repo from github I wasn't able to pip install it from that folder, but that's probably a separate issue, which I can open, if you like.

As you say, I've worked out that the error doesn't affect any functionality, but it's a fairly annoying warning, especially since it contains the word 'fatal', and affects any packages that import this one.