geekpradd / PyDictionary

PyDictionary is a Dictionary Module for Python 2/3 to get meanings, translations, synonyms and antonyms of words
https://pypi.python.org/pypi/PyDictionary
MIT License
272 stars 65 forks source link

not installing properly. #52

Open Krishna-aishwarya opened 2 years ago

Krishna-aishwarya commented 2 years ago
Collecting PyDictionary
  Downloading PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Requirement already satisfied: click in /home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages (from PyDictionary) (8.0.3)
Requirement already satisfied: requests in /home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages (from PyDictionary) (2.26.0)
Collecting goslate
  Downloading goslate-1.5.2.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: bs4 in /home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages (from PyDictionary) (0.0.1)
Requirement already satisfied: beautifulsoup4 in /home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages (from bs4->PyDictionary) (4.10.0)
Collecting futures
  Downloading futures-3.0.5.tar.gz (25 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/__init__.py", line 18, in <module>
          from setuptools.dist import Distribution
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 32, in <module>
          from setuptools.extern.more_itertools import unique_everseen
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
        File "<frozen importlib._bootstrap>", line 565, in module_from_spec
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/extern/__init__.py", line 52, in create_module
          return self.load_module(spec.name)
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/extern/__init__.py", line 37, in load_module
          __import__(extant)
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/__init__.py", line 1, in <module>
          from .more import *  # noqa
        File "/home/krshnaaishwaryad/anaconda3/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/more.py", line 5, in <module>
          from concurrent.futures import ThreadPoolExecutor
        File "/tmp/pip-install-y11dm6z8/futures_f83793109feb42f2bb50f12844581d63/concurrent/futures/__init__.py", line 8, in <module>
          from concurrent.futures._base import (FIRST_COMPLETED,
        File "/tmp/pip-install-y11dm6z8/futures_f83793109feb42f2bb50f12844581d63/concurrent/futures/_base.py", line 357
          raise type(self._exception), self._exception, self._traceback
                                     ^
      SyntaxError: invalid syntax
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Doom666 commented 2 years ago

I am also experiencing this

Ananym commented 2 years ago

Yep. Up to date pip and setuptools, same error.

Titanium2099 commented 2 years ago

same

dvorakstephen11 commented 2 years ago

Ditto, using pipenv

Pikamander2 commented 2 years ago

Pinging @geekpradd @bunchesofdonald @hpanago @morgansliman @njvrzm -

PyDictionary appears to be uninstallable on Python 3.10.

If the repo is no longer being maintained, would it be possible to add someone here to the project to help get it fixed?

bunchesofdonald commented 2 years ago

I don't have any privileges on this repo. But I did some debugging I think the actual issue here is that goslate depends on futures, and futures >=3.0.0 isn't installable on python3 at all. The pypi page calls this out saying It does not work on Python 3 due to Python 2 syntax being used in the codebase. Python 3 users should not attempt to install it, since the package is already included in the standard library. -- https://pypi.org/project/futures/

I am able to work around the issue by installing futures <3.0.0 before installing PyDictionary:

$ docker run --rm -it --entrypoint=/bin/bash python:3.10
root@7acd642446ca:/# pip install 'futures<3.0.0'
Collecting futures<3.0.0
  Downloading futures-2.2.0-py2.py3-none-any.whl (16 kB)
Installing collected packages: futures
Successfully installed futures-2.2.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@7acd642446ca:/# pip install PyDictionary
Collecting PyDictionary
  Downloading PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Collecting requests
  Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.1/63.1 KB 5.9 MB/s eta 0:00:00
Collecting goslate
  Downloading goslate-1.5.2.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Collecting bs4
  Downloading bs4-0.0.1.tar.gz (1.1 kB)
  Preparing metadata (setup.py) ... done
Collecting click
  Downloading click-8.1.2-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 KB 31.6 MB/s eta 0:00:00
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.2/128.2 KB 52.0 MB/s eta 0:00:00
Requirement already satisfied: futures in /usr/local/lib/python3.10/site-packages (from goslate->PyDictionary) (2.2.0)
Collecting idna<4,>=2.5
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 KB 19.8 MB/s eta 0:00:00
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.0/139.0 KB 55.7 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.2/149.2 KB 53.2 MB/s eta 0:00:00
Collecting soupsieve>1.2
  Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)
Building wheels for collected packages: bs4, goslate
  Building wheel for bs4 (setup.py) ... done
  Created wheel for bs4: filename=bs4-0.0.1-py3-none-any.whl size=1272 sha256=7fe4ee2fd5d583484d02df52a16985d478b2dffb0ce0091ab87f5c2a51460c75
  Stored in directory: /root/.cache/pip/wheels/25/42/45/b773edc52acb16cd2db4cf1a0b47117e2f69bb4eb300ed0e70
  Building wheel for goslate (setup.py) ... done
  Created wheel for goslate: filename=goslate-1.5.2-py3-none-any.whl size=11436 sha256=a585bd7bea3b5530a3f2c80bc81b1f74c0fb3e3a1af7d034d2dfac75ae48a890
  Stored in directory: /root/.cache/pip/wheels/60/70/49/b223667b589e6efe25bedf77aaa99c7c1a3149bf6f2198f7ae
Successfully built bs4 goslate
Installing collected packages: certifi, urllib3, soupsieve, idna, goslate, click, charset-normalizer, requests, beautifulsoup4, bs4, PyDictionary
Successfully installed PyDictionary-2.0.1 beautifulsoup4-4.11.1 bs4-0.0.1 certifi-2021.10.8 charset-normalizer-2.0.12 click-8.1.2 goslate-1.5.2 idna-3.3 requests-2.27.1 soupsieve-2.3.2.post1 urllib3-1.26.9
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@7acd642446ca:/# python
Python 3.10.4 (main, Apr 20 2022, 18:15:27) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyDictionary import PyDictionary
>>> dictionary = PyDictionary()
>>> print(dictionary.meaning("indentation"))
{'Noun': ['a concave cut into a surface or edge (as in a coastline', 'the formation of small pits in a surface as a consequence of corrosion', 'the space left between the margin and the start of an indented line', 'the act of cutting into an edge with toothlike notches or angular incisions']}

Simple usage appears to be working as expected, but it does appear that Google translation is broken (which uses goslate):

>>> print(dictionary.translate("Range",'es'))
Invalid Word
None