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

Failed to import xgboost in Python3.5 #5328

Closed
nyanp opened this issue Feb 20, 2020 · 5 comments
Closed

Failed to import xgboost in Python3.5 #5328

nyanp opened this issue Feb 20, 2020 · 5 comments
Assignees

Comments

@nyanp
Copy link

nyanp commented Feb 20, 2020

From xgboost 1.0.0, importing xgboost in Python 3.5 causes an error because of f-strings that is not supported in 3.5.

/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/xgboost/dask.py:33: in <module>
    from .sklearn import XGBModel, XGBClassifierBase, xgboost_model_doc
E     File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/xgboost/sklearn.py", line 437
E       msg = f'Current model type: {type(self).__name__}, ' + \
E                                                          ^
E   SyntaxError: invalid syntax
  • xgboost version: 1.0.0 installed from pip
  • environment: ubuntu-latest in GitHub CI (link to my CI result)

Is Python3.5 no longer supported from 1.0.0?

@hcho3
Copy link
Collaborator

hcho3 commented Feb 20, 2020

F-string should not have been in there. We will patch it.

@hcho3
Copy link
Collaborator

hcho3 commented Feb 20, 2020

#5330 should fix the issue.

@nyanp
Copy link
Author

nyanp commented Feb 20, 2020

Thanks for your quick response :)

@hcho3
Copy link
Collaborator

hcho3 commented Feb 21, 2020

I just released 1.0.1, which is identical to 1.0.0 except that 1.0.1 actually supports Python 3.5.

@hcho3 hcho3 closed this as completed Feb 21, 2020
@trivialfis
Copy link
Member

Score one for semantic versioning.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants