Reputation: 33
I have developed my model using xgboost package in Jupyter Notebook. When we are trying to take it over to the production environment, the client suggested using py-xgboost which is available in their environment.
But in Jupyter Notebook I'm unable to import or install py-xgboost package, since it is not present.
Anyone can help me with this query?
Upvotes: 2
Views: 5244
Reputation: 186
I have the same question. It appears that xgboost and py-xgboost in the conda-forge repo are the same package, and both can be imported using
import xgboost as xgb
However, there are CPU-only versions of those two packages, and other versions which may (?) include GPU support. The pip (PyPi) version of xgboost includes GPU support is usually more up-to-date than both of the above packages on conda-forge.
I had used only the pip version in a conda environment, but then I installed tpot, which has py-xgboost (CPU, e.g. 1.5.1-cpu_py39ha538f94_2) as a dependency. So, now I have both pip xgboost and py-xgboost installed in the same environment. When I import xgboost and check version, it matches the pip version.
One way to get a definitive answer would be to post a question on the xgboost github page.
Upvotes: 3
Reputation: 1291
I'm sure you've tried this, but if it is installed, in Jupyter, you import py-xgboost as
import xgboost
If it is not installed, you in a conda or pip environment?
If not installed and you're using pip, have you tried pip or pip3 install?
pip install xgboost
or
pip3 install xgboost
If not installed and you're using conda,
conda install -c conda-forge xgboost
Sorta tangential, a really easy way (if your GPU is Pascal or higher) you can install RAPIDS via conda guided by this interactive graphic. It will not just install xgboost and py-xgboost, but enable your whole pydata stack take advantage of the GPU acceleration.
Upvotes: 0