Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nlu support on Python 3.8 #11

Closed
javierabosch2 opened this issue Oct 7, 2020 · 15 comments
Closed

nlu support on Python 3.8 #11

javierabosch2 opened this issue Oct 7, 2020 · 15 comments
Assignees
Labels
Feature Request a new feature

Comments

@javierabosch2
Copy link

On import nlu, looks like pyspark/cloudpickle.py is failing with:

TypeError: an interger is required (got type bytes) . On some research, I found this is an issue with running pysark on Python 3.8. I am not sure if this is the only cause, but if it is, i recommend placing a requirements for Python<3.8

@alexott
Copy link
Contributor

alexott commented Oct 7, 2020

It’s coming from pyspark 2.4 that is not running on 3.8... but yes, makes sense to put limit on python version

@C-K-Loan
Copy link
Member

C-K-Loan commented Oct 8, 2020

Thanks for sharing this issue.

We are looking to fix various versioning issues for the next release

@C-K-Loan C-K-Loan self-assigned this Oct 9, 2020
@phoebusg
Copy link

Maybe a similar issue on 3.8.0
AppData\Local\Programs\Python\Python38\lib\site-packages\nlu\components\chunkers\ngram\ngram.py", line 11
.setEnableCumulative(False)
^
SyntaxError: unexpected EOF while parsing

Contents of ngram.py:
import nlu.pipe_components
from sparknlp.annotator import *

class NGram:
@staticmethod
def get_default_model():
return NGramGenerator()
.setInputCols(["token"])
.setOutputCol("ngrams")
.setN(2)
.setEnableCumulative(False) \

@C-K-Loan
Copy link
Member

Hi @phoebusg , thanks for sharing,

this is an issue with the nlu version 1.0.1 which is fixed in nlu 1.0.2 which will be released today.

@phoebusg
Copy link

Thank you C-K, I appreciate the update... looking forward to the release! :)

@phoebusg
Copy link

python .\demo.py
Please use a Python version with version number SMALLER than 3.8
Python versions equal or higher 3.8 is currently NOT SUPPORTED by NLU

:( too lazy to setup an environment with <3.8-- I'll wait for the next update then.

@alexott
Copy link
Contributor

alexott commented Oct 29, 2020

@phoebusg NLU depends on the Spark 2.4 that doesn't work with Python 3.8...

@muhlbach
Copy link

muhlbach commented Apr 1, 2021

Do you guys have any idea when Python >3.8 will be supported by NLU? I think Spark >3.0 should support Python 3.8. Trying to figure out whether I should set up another environment with an earlier Python version.

@C-K-Loan
Copy link
Member

C-K-Loan commented Apr 2, 2021

Hi @muhlbach in the upcoming NLU healthcare release we will support Python 3.8 and Spark 3.0.
The first release candidate will be available in a few days for testing, stay tuned :)

@muhlbach
Copy link

muhlbach commented Apr 2, 2021

@C-K-Loan thanks for your answer! That’s great. Looking forward to being able to use NLU again on Python 3.8.

@C-K-Loan
Copy link
Member

@muhlbach
You can now install and test the Spark 3 and Python3.8 compatible NLU release candidate like this

! pip install  pyspark==3.0.1 spark-nlp==3.0.1 nlu==3.0.0rc2

Stay tuned for the full release this week :)

@C-K-Loan C-K-Loan added the Feature Request a new feature label Apr 13, 2021
@muhlbach
Copy link

@C-K-Loan, thanks! I tried installing the pre-lease and it installed perfectly. However, trying:
import nlu pipe = nlu.load('embed_sentence.bert')
leads to the following error:
Traceback (most recent call last): File "<ipython-input-3-496e026ee915>", line 1, in <module>pipe = nlu.load('embed_sentence.bert') File "/Users/muhlbach/opt/anaconda3/envs/stable/lib/python3.8/site-packages/nlu/__init__.py", line 261, in load pipe.add(nlu_component, nlu_ref) File "/Users/muhlbach/opt/anaconda3/envs/stable/lib/python3.8/site-packages/nlu/pipe/pipeline.py", line 94, in add if hasattr(component.info,'nlu_ref'): nlu_reference = component.info.nlu_ref AttributeError: type object 'NluError' has no attribute 'info'

I'm wondering whether this has something to do with my Java installation?

Here's the version:

java -version openjdk version "13.0.6" 2021-01-19 OpenJDK Runtime Environment Zulu13.37+21-CA (build 13.0.6+5-MTS) OpenJDK 64-Bit Server VM Zulu13.37+21-CA (build 13.0.6+5-MTS, mixed mode)

Btw. I'm running on an Apple M1 chip.

@C-K-Loan
Copy link
Member

C-K-Loan commented Apr 16, 2021

Hi @muhlbach

@maziyarpanahi
Copy link
Member

Just in case your M1 chip had an issue with Java, you can follow this as well: JohnSnowLabs/spark-nlp#2282

@C-K-Loan
Copy link
Member

C-K-Loan commented Apr 19, 2021

NLU 3.0.0 is now released and supports Python 3.8 and Spark 3.1.X and Spark 3.0.X
https://github.com/JohnSnowLabs/nlu/releases

Be aware, if you run with a Spark version below 3, you cannot use Python 3.8, since that is only supported in Spark 3+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request a new feature
Projects
None yet
Development

No branches or pull requests

6 participants