StepfenShawn / Cantonese

粤语編程語言.The Cantonese programming language.
https://cantonese-community.github.io/
MIT License
1.15k stars 46 forks source link

`six` package dependency error #52

Closed dosentmatter closed 2 years ago

dosentmatter commented 2 years ago

Hello, after installing Cantonese, it fails to run because of the import six that isn't included in your list of dependencies. https://github.com/StepfenShawn/Cantonese/blob/3072e3b346225cf2b62538fb6823ae32bee165a6/src/stack_vm.py#L9

https://github.com/StepfenShawn/Cantonese/blob/4870538b948d5a03d2a83b72febeb5bcf2df36f6/setup.cfg#L31-L34

You only support Python 3 in setup.cfg and the README, so it doesn't look like you would need six for Python 2 interoperability. https://github.com/StepfenShawn/Cantonese/blob/4870538b948d5a03d2a83b72febeb5bcf2df36f6/setup.cfg#L30

It doesn't seem like you are using six at all. Can we delete the import six line?

% Cantonese
Traceback (most recent call last):
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/bin/Cantonese", line 5, in <module>
    from src.cantonese import main
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 12, in <module>
    from src.stack_vm import *
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/stack_vm.py", line 9, in <module>
    import six
ModuleNotFoundError: No module named 'six'

The workaround is to pip install six, but this shouldn't be necessary.

StepfenShawn commented 2 years ago

OK, I will delete it in the next version.

dosentmatter commented 2 years ago

Thanks for the fix @StepfenShawn.

Deleted in this commit