Force python to use a older version of a package – xgboost

  pip, python, xgboost

I need to use an older version of xgboost package for compatibility issues. I am attempting to do that with pkg_resources:

import pkg_resources
pkg_resources.require("xgboost==0.90")
import xgboost
from xgboost import XGBRegressor

I get the following error:

VersionConflict: (xgboost 1.5.0 (/Users/anaconda3/lib/python3.8/site-packages), Requirement.parse('xgboost==0.90'))

When I try:

print(xgboost.__version__)
1.5.0

I have tried to pip uninstall and then pip install xgboost==0.90, but it still upgrades to 1.5.0

In my python packages directory, I have the two xgboost packages installed.

/opt/anaconda3/lib/python3.8/site-packages

xgboost
xgboost-0.90-py3.8.egg-info

Source: Python Questions

LEAVE A COMMENT