grambank / pygrambank

Apache License 2.0
4 stars 1 forks source link

still can't run check #15

Closed HedvigS closed 4 years ago

HedvigS commented 4 years ago

Huh, I thought that #14 was going to solve my problem but it appears that wasn't the case.

What should I do differently? I have run setup.py again and pulled down the master branch for pygrambank.

Hedvigs-MBP:pygrambank hedvigskirgard$ grambank --repos /Users/hedvigskirgard/Dropbox/Git/Grambank check --report /Users/hedvigskirgard/Dropbox/Git/Grambank/For_coders/check.tsv

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/grambank", line 11, in <module>
    load_entry_point('pygrambank==1.0.1.dev0', 'console_scripts', 'grambank')()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/__main__.py", line 139, in main
    return args.main(args) or 0
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/commands/check.py", line 34, in run
    for sheet in sheets:
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/api.py", line 25, in iter_sheets
    yield Sheet(p)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/sheet.py", line 82, in __init__
    assert match, 'Invalid sheet name: {0}'.format(path.name)
AssertionError: Invalid sheet name: .DS_Store
xrotwang commented 4 years ago

How did you run setup.py? It seems you have not installed pygrambank in development mode, so changing the source in the clone will not change the installed package.

xrotwang commented 4 years ago

I'd recommend uninstalling:

pip uninstall pygrambank

and installing in dev mode:

pip install -r requirements.txt
HedvigS commented 4 years ago

Okay, trying that now.

HedvigS commented 4 years ago

Had to update pytest-filter-subpackage, but that went well. However, after successfully uninstalling and then installing pygrambank, I get the same runtime error.

xrotwang commented 4 years ago

But the paths of the source files in the error message should be different now, i.e. point to files in your clone of pygrambank, rather than to files in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/

xrotwang commented 4 years ago

How do you install pygrambank?

xrotwang commented 4 years ago

Just added a .DS_Store to my repos and can confirm that the fix works as intended:

$ ll original_sheets/.DS_Store 
-rw-r--r-- 1 forkel@shh.mpg.de domain users@shh.mpg.de 3 Jul 10 18:07 original_sheets/.DS_Store

and grambank check runs.

HedvigS commented 4 years ago

I installed pygrambank by running

pip install -r requirements.txt

The current error message reads:```

Hedvigs-MBP:pygrambank hedvigskirgard$ grambank --repos /Users/hedvigskirgard/Dropbox/Git/Grambank check --report /Users/hedvigskirgard/Dropbox/Git/Grambank/For_coders/check.tsv Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/grambank", line 11, in load_entry_point('pygrambank==1.0.1.dev0', 'console_scripts', 'grambank')() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/main.py", line 139, in main return args.main(args) or 0 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/commands/check.py", line 34, in run for sheet in sheets: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/api.py", line 25, in iter_sheets yield Sheet(p) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygrambank-1.0.1.dev0-py3.7.egg/pygrambank/sheet.py", line 82, in init assert match, 'Invalid sheet name: {0}'.format(path.name) AssertionError: Invalid sheet name: .DS_Store

xrotwang commented 4 years ago

It seems the pip uninstall pygrambank did not really work. The installed code is still not your clone of the sources. Can you run pip freeze | grep pygrambank? Results should look similar to

$ pip freeze | grep pygrambank
-e git+https://github.com/glottobank/pygrambank.git@c09c82131232a1b05b22565d63c97b9043672e8e#egg=pygrambank
HedvigS commented 4 years ago

Yeah, we just came to the same conclusion. Okay, we'll try that.

xrotwang commented 4 years ago

See https://stackoverflow.com/a/1550235

HedvigS commented 4 years ago

Okay, we solved it now. I should be using pip3.

I don't fully understand, but I know that I have several pips and pythons installed on this machine. Christoph was helping me with this a while ago, and I have yet to fully understand what is going on. For now, it appears that all i should be doing is using pip3 instead of pip. Ste figured it out :)

xrotwang commented 4 years ago

Generally, you might be better of using virtual environments for each project you are working on. In a python3 virtualenv pip and python will resolve to the appropriate programs, i.e. will be links to pip3 and python3.

HedvigS commented 4 years ago

That sounds really good, I don't know how to set that up and I don't want to tax my fiancee too much. Maybe with this new machine that I just got I can make this happen, if I can get help?

HedvigS commented 4 years ago

This scares me too much.

xrotwang commented 4 years ago

I didn't recommend using pyenv.

HedvigS commented 4 years ago

Okay. Well, without help I can't really tell what to do either way, and starting doing it on my own seems very daunting. My experiences on my own machine so far has shown me that python package and versioning management can be quite complex, and I certainly don't feel comfortable doing anything new. I can read basic python code, I do not yet feel confident in this space.