tasdikrahman / vocabulary

[Not Maintained anymore] Python Module to get Meanings, Synonyms and what not for a given word
https://vocabulary.readthedocs.io/en/latest/
MIT License
560 stars 76 forks source link

Installation issues on Mac #34

Closed kshitij10496 closed 7 years ago

kshitij10496 commented 7 years ago

Hey, I tried to install the package using pip but I'm getting an error. I have added the traceback below:

$ pip3 install vocabulary
Collecting vocabulary
  Downloading Vocabulary-1.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/setup.py", line 22, in <module>
        with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/requirements.txt'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-4zb4lgql/vocabulary/

I wasn't able to install Vocabulary in a clean virtual environment (with no installations of requests and mock) either.

$ pip install vocabulary
Collecting vocabulary
  Using cached Vocabulary-1.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/setup.py", line 12, in <module>
        from vocabulary.version import VERSION
      File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/vocabulary/__init__.py", line 5, in <module>
        from .vocabulary import Vocabulary
      File "/private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/vocabulary/vocabulary.py", line 25, in <module>
        import requests
    ImportError: No module named 'requests'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bd/tp7n9v393ml9src1bt4m70180000gn/T/pip-build-erniz75j/vocabulary/

As can be observed in the traceback, this issue is due to the import statement in __init__.py module which . How about we move define the version and release in the setup.py itself so as to keep things condensed ?

On a separate note, I believe that we are using rather constrained dependency package versions. For example, any version of requests above 2.0.0 should work fine as a dependency. What's your take on this?

tasdikrahman commented 7 years ago

@kshitij10496

How about we move define the version and release in the setup.py itself so as to keep things condensed ?

As of now, the version and release vars are inside the package vocabulary, this way we are keeping it DRY.

Right now I have made a quick fix in setup.py here at https://github.com/prodicus/vocabulary/blob/1.0.4/setup.py#L15-L26 for a failing

$ pip install vocabulary --no-cache
Collecting vocabulary
  Downloading Vocabulary-1.0.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sw/nsjcqtxs1yldt7y1gsqkfnw00000gn/T/pip-build-trous1cm/vocabulary/setup.py", line 22, in <module>
        with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/sw/nsjcqtxs1yldt7y1gsqkfnw00000gn/T/pip-build-trous1cm/vocabulary/requirements.txt'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sw/nsjcqtxs1yldt7y1gsqkfnw00000gn/T/pip-build-trous1cm/vocabulary/

Need to create an issue and fix that

On a separate note, I believe that we are using rather constrained dependency package versions. For example, any version of requests above 2.0.0 should work fine as a dependency. What's your take on this?

Please read https://www.kennethreitz.org/essays/a-better-pip-workflow :)

Happy to answer anything else that you have in mind