Trying to run tests (my virtual env is active), I've got the following error
ImportError while importing test module '/home/ania/Projects/scikit-optimize/skopt/tests/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.6/tkinter/__init__.py:37: in <module>
import _tkinter
E ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
skopt/__init__.py:55: in <module>
from . import plots
skopt/plots.py:5: in <module>
import matplotlib.pyplot as plt
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/matplotlib/pyplot.py:115: in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/matplotlib/backends/__init__.py:32: in pylab_setup
globals(),locals(),[backend_name],0)
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py:6: in <module>
from six.moves import tkinter as Tk
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/six.py:92: in __get__
result = self._resolve()
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/six.py:115: in _resolve
return _import_module(self.mod)
../../.virtualenvs/skopt-env/lib/python3.6/site-packages/six.py:82: in _import_module
__import__(name)
/usr/lib/python3.6/tkinter/__init__.py:39: in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
E ImportError: No module named '_tkinter', please install the python3-tk package
I'm using virtualenvwrapper
Could you post the commands to type to create a virtualenv and install scikit-optimize?
Creating a virtualenv:
mkvirtualenv -a scikit-optimize -r scikit-optimize/requirements.txt -v skopt-env -p python3.6
Then I tried to run tests and needed to install the following packages (not in requirements):
logilab-common
pytest
At this point I faced the error from the title. The solution was installing
sudo apt-get install python3.6-tk (outside the venv)
Then I also missed nose. Installing it helped. Tests passed :)
To sum up, pip requirements:
logilab-common
pytest
nose
Sys requirements:
sudo apt-get install python3.6-tk
Let's add nose and pytest (see #495). Not sure about adding logilab-common, I don't think it is a direct dependency of scikit-optimize :-/
I tried from scratch and without logilab-common it works :)
closing
Most helpful comment
I tried from scratch and without
logilab-commonit works :)