charliermarsh / semantic

A Python library for extracting semantic information from text, such as dates and numbers.
MIT License
74 stars 20 forks source link

Does not work on python3 #9

Open guysoft opened 8 years ago

guysoft commented 8 years ago

Hey, I ran pip3 install semantic, it install successfully but then fails since the calls are build for python2.

Has anyone ported to python3?

fake-name commented 8 years ago

I'm using the numbering stuff in py3k, at least, though it all imports.

See my fork: https://github.com/fake-name/semantic

guysoft commented 8 years ago

Not relevant for me anymore. Might be for others.

dipanm commented 7 years ago

Broke this for me on Python3 as well.

sudo pip3 install semantic

Collecting semantic
  Downloading semantic-1.0.3.tar.gz
Collecting quantities (from semantic)
  Downloading quantities-0.11.1.zip (105kB)
    100% |████████████████████████████████| 112kB 334kB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (from semantic)
Building wheels for collected packages: semantic, quantities
  Running setup.py bdist_wheel for semantic ... done
  Stored in directory: /home/<usr>/.cache/pip/wheels/45/0c/3d/35ba2354ac8de03085e3fb319ce2a7af92f5dc7f0c7156a1c6
  Running setup.py bdist_wheel for quantities ... done
  Stored in directory: /home/<usr>/.cache/pip/wheels/79/85/98/574e4549c9453289f1892756e1db968e4a8f2361842dfb7aba

Successfully built semantic quantities
Installing collected packages: quantities, semantic
Successfully installed quantities-0+unknown semantic-1.0.3

Once this was done: 

$  python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from semantic.dates import DateService
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/semantic/dates.py", line 360
    def merge((day, time)):
              ^
SyntaxError: invalid syntax

Looks like broken package for python3.

System Info:

$ uname -a
Linux Vostro 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:   xenial
$ python3 --version
Python 3.5.2
$ pip freeze
adium-theme-ubuntu==0.3.4
asn1crypto==0.22.0
attrs==15.2.0
beautifulsoup4==4.4.1
boto==2.38.0
CDApplet==1.0
CDBashApplet==1.0
certifi==2017.4.17
cffi==1.10.0
chardet==2.3.0
cryptography==1.2.3
cssselect==1.0.1
decorator==4.0.6
Django==1.8.7
enum34==1.1.6
html5lib==0.999
idna==2.5
ipaddress==1.0.18
ipython==2.4.1
lxml==3.5.0
mysqlclient==1.3.7
ndg-httpsclient==0.4.0
packaging==16.8
PAM==0.4.2
parsel==1.1.0
pexpect==4.0.1
Pillow==3.1.2
ptyprocess==0.5
pyasn1==0.2.3
pyasn1-modules==0.0.8
pycparser==2.17
pycrypto==2.6.1
Pygments==2.1
pyOpenSSL==0.15.1
pyparsing==2.2.0
pyserial==3.0.1
pytz==2014.10
queuelib==1.4.2
requests==2.13.0
Scrapy==1.0.3
service-identity==16.0.0
simplegeneric==0.8.1
six==1.10.0
sqlparse==0.1.18
Twisted==16.0.0
unity-lens-photos==1.0
urllib3==1.13.1
w3lib==1.17.0
zope.interface==4.1.3

Let me know if there is a way out!!

aspiringguru commented 6 years ago

arrived here with similar problem. python 3.5.5 on Win 10 ver 1803

from semantic.dates import DateService err @ line 360 of semantic\dates.py

NumberService works ok.

from semantic.solver import MathService error @ line 3 of semantic\solver