0

XGBoost needs to be compiled. For Docker, I install it like this:

RUN git clone --recursive https://github.com/dmlc/xgboost.git
WORKDIR xgboost
RUN ./build.sh && pip3 install -e python-package

How can I make sure it is available for tox?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958

1 Answers1

1

Option sitepackages=True makes tox create virtual envs that have access to globally installed packages. It's an option of virtual env section or global [testenv] section. Also can be set with --sitepackages command line option. Example:

[tox]
minversion = 1.8
envlist = py{27,34,35,36}

# Base test environment settings
[testenv]
basepython =
    py27: {env:TOXPYTHON:python2.7}
    py34: {env:TOXPYTHON:python3.4}
    py35: {env:TOXPYTHON:python3.5}
    py36: {env:TOXPYTHON:python3.6}
sitepackages=True
phd
  • 82,685
  • 13
  • 120
  • 165
  • I still get `ModuleNotFoundError: No module named 'xgboost'` after adding this line. Could you add a complete `tox.ini`? – Martin Thoma Jan 30 '18 at 14:43
  • Added an example. Can you import `xgboost` in a global python after `pip3 install -e python-package`? BTW, why `install -e`, why not just `install`? – phd Jan 30 '18 at 14:48