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

Error when executing pytest on jupyterhub/test/ #1001

Closed
nickylimjj opened this issue Feb 26, 2017 · 5 comments
Closed

Error when executing pytest on jupyterhub/test/ #1001

nickylimjj opened this issue Feb 26, 2017 · 5 comments
Milestone

Comments

@nickylimjj
Copy link

execute pytest jupyterhub/tests

I exepcted test to run to completion, but there was a ImportError: cannot import name TimeoutExpired. I tried python3 -m pytest jupyterhub/test instead but test_api.py threw a whole string or 'E's.

Jupyter hub v0.8.0.dev

Running jupyter troubleshoot from the command line, if possible, and posting
its output would also be helpful.


$ jupyter troubleshoot
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
$PATH:
	/Users/nicky/anaconda2/bin
	/Users/nicky/anaconda2/bin
	/usr/local/opt/openssl/bin
	/Users/nicky/.npm-packages/bin
	/usr/local/bin
	/opt/local/bin
	/opt/local/sbin
	/usr/local/bin
	/usr/bin
	/bin
	/usr/sbin
	/sbin
	/opt/X11/bin
	/Library/TeX/texbin
	/Users/nicky/.rvm/bin
	/Users/nicky/anaconda3/bin
	/Users/nicky/bin

sys.path:
	/Users/nicky/anaconda2/bin
	/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib
	/Users/nicky/anaconda2/lib/python27.zip
	/Users/nicky/anaconda2/lib/python2.7
	/Users/nicky/anaconda2/lib/python2.7/plat-darwin
	/Users/nicky/anaconda2/lib/python2.7/plat-mac
	/Users/nicky/anaconda2/lib/python2.7/plat-mac/lib-scriptpackages
	/Users/nicky/anaconda2/lib/python2.7/lib-tk
	/Users/nicky/anaconda2/lib/python2.7/lib-old
	/Users/nicky/anaconda2/lib/python2.7/lib-dynload
	/Users/nicky/.local/lib/python2.7/site-packages
	/Users/nicky/sandbox/hackillinois2017/jupyter/notebook
	/Users/nicky/anaconda2/lib/python2.7/site-packages
	/Users/nicky/anaconda2/lib/python2.7/site-packages/Sphinx-1.5.1-py2.7.egg
	/Users/nicky/anaconda2/lib/python2.7/site-packages/aeosa
	/Users/nicky/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg

sys.executable:
	/Users/nicky/anaconda2/bin/python

sys.version:
	2.7.13 |Anaconda 4.3.0 (x86_64)| (default, Dec 20 2016, 23:05:08) 
	[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

platform.platform():
	Darwin-15.6.0-x86_64-i386-64bit

which -a jupyter:
	/Users/nicky/anaconda2/bin/jupyter
	/Users/nicky/anaconda2/bin/jupyter
	/usr/local/bin/jupyter
	/usr/local/bin/jupyter

pip list:
	alabaster (0.7.9)
	anaconda-client (1.6.0)
	anaconda-navigator (1.4.3)
	appdirs (1.4.2)
	appnope (0.1.0)
	appscript (1.0.1)
	argcomplete (1.0.0)
	astroid (1.4.9)
	astropy (1.3)
	Babel (2.3.4)
	backports-abc (0.5)
	backports.shutil-get-terminal-size (1.0.0)
	backports.ssl-match-hostname (3.4.0.2)
	beautifulsoup4 (4.5.3)
	bitarray (0.8.1)
	blaze (0.10.1)
	bokeh (0.12.4)
	boto (2.45.0)
	Bottleneck (1.2.0)
	cdecimal (2.3)
	cffi (1.9.1)
	chardet (2.3.0)
	chest (0.2.3)
	click (6.7)
	cloudpickle (0.2.2)
	clyent (1.2.2)
	colorama (0.3.7)
	conda (4.3.13)
	configobj (5.0.6)
	configparser (3.5.0)
	contextlib2 (0.5.4)
	cryptography (1.7.1)
	cycler (0.10.0)
	Cython (0.25.2)
	cytoolz (0.8.2)
	dask (0.13.0)
	datashape (0.5.4)
	decorator (4.0.11)
	dill (0.2.5)
	docutils (0.13.1)
	enum34 (1.1.6)
	et-xmlfile (1.0.1)
	fastcache (1.0.2)
	Flask (0.12)
	Flask-Cors (3.0.2)
	funcsigs (1.0.2)
	functools32 (3.2.3.post2)
	futures (3.0.5)
	gevent (1.2.1)
	greenlet (0.4.11)
	grin (1.2.1)
	h5py (2.6.0)
	HeapDict (1.0.0)
	idna (2.2)
	imagesize (0.7.1)
	ipaddress (1.0.18)
	ipykernel (4.5.2)
	ipython (5.1.0)
	ipython-genutils (0.1.0)
	ipywidgets (5.2.2)
	isort (4.2.5)
	itsdangerous (0.24)
	jdcal (1.3)
	jedi (0.9.0)
	Jinja2 (2.9.4)
	jsonschema (2.5.1)
	jupyter (1.0.0)
	jupyter-client (4.4.0)
	jupyter-console (5.0.0)
	jupyter-core (4.2.1)
	lazy-object-proxy (1.2.2)
	llvmlite (0.15.0)
	locket (0.2.0)
	lxml (3.7.2)
	MarkupSafe (0.23)
	matplotlib (2.0.0)
	mistune (0.7.3)
	mpmath (0.19)
	multipledispatch (0.4.9)
	nbconvert (4.2.0)
	nbformat (4.2.0)
	networkx (1.11)
	nltk (3.2.2)
	nose (1.3.7)
	notebook (5.0.0.dev0, /Users/nicky/sandbox/hackillinois2017/jupyter/notebook)
	numba (0.30.1+0.g8c1033f.dirty)
	numexpr (2.6.1)
	numpy (1.11.3)
	numpydoc (0.6.0)
	odo (0.5.0)
	openpyxl (2.4.1)
	packaging (16.8)
	pandas (0.19.2)
	partd (0.3.7)
	pathlib2 (2.2.0)
	patsy (0.4.1)
	pep8 (1.7.0)
	pexpect (4.2.1)
	pickleshare (0.7.4)
	Pillow (4.0.0)
	pip (9.0.1)
	ply (3.9)
	prompt-toolkit (1.0.9)
	psutil (5.0.1)
	ptyprocess (0.5.1)
	py (1.4.32)
	pyasn1 (0.1.9)
	PyAudio (0.2.7)
	pycosat (0.6.1)
	pycparser (2.17)
	pycrypto (2.6.1)
	pycurl (7.43.0)
	pyflakes (1.5.0)
	Pygments (2.1.3)
	pylint (1.6.4)
	pyOpenSSL (16.2.0)
	pyparsing (2.1.10)
	pytest (3.0.5)
	python-dateutil (2.6.0)
	pytz (2016.10)
	PyYAML (3.12)
	pyzmq (16.0.2)
	QtAwesome (0.4.3)
	qtconsole (4.2.1)
	QtPy (1.2.1)
	redis (2.10.5)
	requests (2.12.4)
	rope (0.9.4)
	scandir (1.4)
	scikit-image (0.12.3)
	scikit-learn (0.18.1)
	scipy (0.18.1)
	seaborn (0.7.1)
	setuptools (34.3.0)
	simplegeneric (0.8.1)
	singledispatch (3.4.0.3)
	six (1.10.0)
	snowballstemmer (1.2.1)
	sockjs-tornado (1.0.3)
	Sphinx (1.5.1)
	spyder (3.1.2)
	SQLAlchemy (1.1.5)
	statsmodels (0.6.1)
	subprocess32 (3.2.7)
	sympy (1.0)
	tables (3.3.0)
	terminado (0.6)
	toolz (0.8.2)
	tornado (4.4.2)
	traitlets (4.3.1)
	unicodecsv (0.14.1)
	wcwidth (0.1.7)
	Werkzeug (0.11.15)
	wheel (0.29.0)
	widgetsnbextension (1.2.6)
	wrapt (1.10.8)
	xlrd (1.0.0)
	XlsxWriter (0.9.6)
	xlwings (0.10.2)
	xlwt (1.2.0)
	yt (3.3.4)

conda list:
	# packages in environment at /Users/nicky/anaconda2:
	#
	_license                  1.1                      py27_1  
	alabaster                 0.7.9                    py27_0  
	anaconda                  4.3.0               np111py27_0  
	anaconda-client           1.6.0                    py27_0  
	anaconda-navigator        1.4.3                    py27_0  
	appnope                   0.1.0                    py27_0  
	appscript                 1.0.1                    py27_0  
	argcomplete               1.0.0                    py27_1  
	astroid                   1.4.9                    py27_0  
	astropy                   1.3                 np111py27_0  
	babel                     2.3.4                    py27_0  
	backports                 1.0                      py27_0  
	backports_abc             0.5                      py27_0  
	beautifulsoup4            4.5.3                    py27_0  
	bitarray                  0.8.1                    py27_0  
	blaze                     0.10.1                   py27_0  
	bokeh                     0.12.4                   py27_0  
	boto                      2.45.0                   py27_0  
	bottleneck                1.2.0               np111py27_0  
	cdecimal                  2.3                      py27_2  
	cffi                      1.9.1                    py27_0  
	chardet                   2.3.0                    py27_0  
	chest                     0.2.3                    py27_0  
	click                     6.7                      py27_0  
	cloudpickle               0.2.2                    py27_0  
	clyent                    1.2.2                    py27_0  
	colorama                  0.3.7                    py27_0  
	conda                     4.3.13                   py27_0    anaconda
	conda-env                 2.6.0                         0    anaconda
	configobj                 5.0.6                    py27_0  
	configparser              3.5.0                    py27_0  
	contextlib2               0.5.4                    py27_0  
	cryptography              1.7.1                    py27_0  
	curl                      7.52.1                        0  
	cycler                    0.10.0                   py27_0  
	cython                    0.25.2                   py27_0  
	cytoolz                   0.8.2                    py27_0  
	dask                      0.13.0                   py27_0  
	datashape                 0.5.4                    py27_0  
	decorator                 4.0.11                   py27_0  
	dill                      0.2.5                    py27_0  
	docutils                  0.13.1                   py27_0  
	entrypoints               0.2.2                    py27_0  
	enum34                    1.1.6                    py27_0  
	et_xmlfile                1.0.1                    py27_0  
	fastcache                 1.0.2                    py27_1  
	flask                     0.12                     py27_0  
	flask-cors                3.0.2                    py27_0  
	freetype                  2.5.5                         2  
	funcsigs                  1.0.2                    py27_0  
	functools32               3.2.3.2                  py27_0  
	futures                   3.0.5                    py27_0  
	get_terminal_size         1.0.0                    py27_0  
	gevent                    1.2.1                    py27_0  
	greenlet                  0.4.11                   py27_0  
	grin                      1.2.1                    py27_3  
	h5py                      2.6.0               np111py27_2  
	hdf5                      1.8.17                        1  
	heapdict                  1.0.0                    py27_1  
	icu                       54.1                          0  
	idna                      2.2                      py27_0  
	imagesize                 0.7.1                    py27_0  
	ipaddress                 1.0.18                   py27_0  
	ipykernel                 4.5.2                    py27_0  
	ipython                   5.1.0                    py27_1  
	ipython_genutils          0.1.0                    py27_0  
	ipywidgets                5.2.2                    py27_1  
	isort                     4.2.5                    py27_0  
	itsdangerous              0.24                     py27_0  
	jbig                      2.1                           0  
	jdcal                     1.3                      py27_0  
	jedi                      0.9.0                    py27_1  
	jinja2                    2.9.4                    py27_0  
	jpeg                      9b                            0  
	jsonschema                2.5.1                    py27_0  
	jupyter                   1.0.0                    py27_3  
	jupyter_client            4.4.0                    py27_0  
	jupyter_console           5.0.0                    py27_0  
	jupyter_core              4.2.1                    py27_0  
	lazy-object-proxy         1.2.2                    py27_0  
	libiconv                  1.14                          0  
	libpng                    1.6.27                        0  
	libtiff                   4.0.6                         3  
	libxml2                   2.9.4                         0  
	libxslt                   1.1.29                        0  
	llvmlite                  0.15.0                   py27_0  
	locket                    0.2.0                    py27_1  
	lxml                      3.7.2                    py27_0  
	markupsafe                0.23                     py27_2  
	matplotlib                2.0.0               np111py27_0  
	mistune                   0.7.3                    py27_1  
	mkl                       2017.0.1                      0  
	mkl-service               1.1.2                    py27_3  
	mpmath                    0.19                     py27_1  
	multipledispatch          0.4.9                    py27_0  
	nbconvert                 4.2.0                    py27_0  
	nbformat                  4.2.0                    py27_0  
	networkx                  1.11                     py27_0  
	nltk                      3.2.2                    py27_0  
	nodejs                    4.2.6                         0  
	nose                      1.3.7                    py27_1  
	notebook                  4.3.1                    py27_0  
	numba                     0.30.1              np111py27_0  
	numexpr                   2.6.1               np111py27_2  
	numpy                     1.11.3                   py27_0  
	numpydoc                  0.6.0                    py27_0  
	odo                       0.5.0                    py27_1  
	openpyxl                  2.4.1                    py27_0  
	openssl                   1.0.2k                        0  
	pandas                    0.19.2              np111py27_1  
	partd                     0.3.7                    py27_0  
	path.py                   10.0                     py27_0  
	pathlib2                  2.2.0                    py27_0  
	patsy                     0.4.1                    py27_0  
	pep8                      1.7.0                    py27_0  
	pexpect                   4.2.1                    py27_0  
	pickleshare               0.7.4                    py27_0  
	pillow                    4.0.0                    py27_0  
	pip                       9.0.1                    py27_1  
	ply                       3.9                      py27_0  
	prompt_toolkit            1.0.9                    py27_0  
	psutil                    5.0.1                    py27_0  
	ptyprocess                0.5.1                    py27_0  
	py                        1.4.32                   py27_0  
	pyasn1                    0.1.9                    py27_0  
	pyaudio                   0.2.7                    py27_0  
	pycosat                   0.6.1                    py27_1  
	pycparser                 2.17                     py27_0  
	pycrypto                  2.6.1                    py27_4  
	pycurl                    7.43.0                   py27_2  
	pyflakes                  1.5.0                    py27_0  
	pygments                  2.1.3                    py27_0  
	pylint                    1.6.4                    py27_1  
	pyopenssl                 16.2.0                   py27_0  
	pyparsing                 2.1.4                    py27_0  
	pyqt                      5.6.0                    py27_1  
	pytables                  3.3.0               np111py27_0  
	pytest                    3.0.5                    py27_0    anaconda
	python                    2.7.13                        0  
	python-dateutil           2.6.0                    py27_0  
	python.app                1.2                      py27_4  
	pytz                      2016.10                  py27_0  
	pyyaml                    3.12                     py27_0  
	pyzmq                     16.0.2                   py27_0  
	qt                        5.6.2                         0  
	qtawesome                 0.4.3                    py27_0  
	qtconsole                 4.2.1                    py27_1  
	qtpy                      1.2.1                    py27_0  
	readline                  6.2                           2  
	redis                     3.2.0                         0  
	redis-py                  2.10.5                   py27_0  
	requests                  2.12.4                   py27_0  
	rope                      0.9.4                    py27_1  
	ruamel_yaml               0.11.14                  py27_1  
	scandir                   1.4                      py27_0  
	scikit-image              0.12.3              np111py27_1  
	scikit-learn              0.18.1              np111py27_1  
	scipy                     0.18.1              np111py27_1  
	seaborn                   0.7.1                    py27_0  
	setuptools                27.2.0                   py27_0  
	simplegeneric             0.8.1                    py27_1  
	singledispatch            3.4.0.3                  py27_0  
	sip                       4.18                     py27_0  
	six                       1.10.0                   py27_0  
	snowballstemmer           1.2.1                    py27_0  
	sockjs-tornado            1.0.3                    py27_0  
	sphinx                    1.5.1                    py27_0  
	spyder                    3.1.2                    py27_0  
	sqlalchemy                1.1.5                    py27_0  
	sqlite                    3.13.0                        0  
	ssl_match_hostname        3.4.0.2                  py27_1  
	statsmodels               0.6.1               np111py27_1  
	subprocess32              3.2.7                    py27_0  
	sympy                     1.0                      py27_0  
	terminado                 0.6                      py27_0  
	tk                        8.5.18                        0  
	toolz                     0.8.2                    py27_0  
	tornado                   4.4.2                    py27_0  
	traitlets                 4.3.1                    py27_0  
	unicodecsv                0.14.1                   py27_0  
	wcwidth                   0.1.7                    py27_0  
	werkzeug                  0.11.15                  py27_0  
	wheel                     0.29.0                   py27_0  
	widgetsnbextension        1.2.6                    py27_0  
	wrapt                     1.10.8                   py27_0  
	xlrd                      1.0.0                    py27_0  
	xlsxwriter                0.9.6                    py27_0  
	xlwings                   0.10.2                   py27_0  
	xlwt                      1.2.0                    py27_0  
	xz                        5.2.2                         1  
	yaml                      0.1.6                         0  
	yt                        3.3.4               np111py27_2    conda-forge
	zlib                      1.2.8                         3


Thanks!

@minrk
Copy link
Member

minrk commented Feb 26, 2017

JupyterHub only runs with Python 3, so make sure that JupyterHub and pytest are installed in a Python 3 environment. For instance:

pip install -r dev-requirements.txt -e .

from the JupyterHub repo.

@minrk minrk added this to the NA milestone Feb 26, 2017
@nickylimjj
Copy link
Author

Hi, I am still running into the issue even after running it in a virtual environment shown below

python3 -m venv myenv
source myenv/bin/activate
pip install -r dev-requirements.txt -e .

In running pytest jupyterhub/tests The following are the notable errors

--------------------------------- Captured stderr call ----------------------------------
[W 00:53.809 MockHub app:448] JupyterHub.api_tokens is pending deprecation.  Consider using JupyterHub.service_tokens.  If you have a use case for services that identify as users, let us know: https://github.com/jupyterhub/jupyterhub/issues
[I 00:53.818 MockHub app:745] Loading cookie_secret from /Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/jupyterhub_cookie_secret
[E 00:53.819 MockHub app:772] Refusing to run JupyterHub with invalid cookie_secret_file. /Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/jupyterhub_cookie_secret error was: Non-hexadecimal digit found
==================== 1 failed, 83 passed, 35 error in 63.49 seconds =====================
(myenv) 

The following is the jupyter troubleshoot output

$PATH:
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin
	/usr/local/opt/openssl/bin
	/Users/nicky/.npm-packages/bin
	/Users/nicky/bin
	/opt/local/bin
	/opt/local/sbin
	/usr/local/bin
	/usr/bin
	/bin
	/usr/sbin
	/sbin
	/opt/X11/bin
	/Library/TeX/texbin
	/Users/nicky/.rvm/bin
	/Users/nicky/anaconda3/bin

sys.path:
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub
	/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib
	/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python35.zip
	/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5
	/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin
	/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/lib/python3.5/site-packages

sys.executable:
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin/python3

sys.version:
	3.5.2 (default, Oct 11 2016, 05:05:28) 
	[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)]

platform.platform():
	Darwin-15.6.0-x86_64-i386-64bit

which -a jupyter:
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin/jupyter
	/Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/myenv/bin/jupyter
	/usr/local/bin/jupyter

pip list:
	alembic (0.8.10)
	appnope (0.1.0)
	bleach (1.5.0)
	codecov (2.0.5)
	coverage (4.3.4)
	decorator (4.0.11)
	entrypoints (0.2.2)
	html5lib (0.9999999)
	ipykernel (4.5.2)
	ipython (5.3.0)
	ipython-genutils (0.1.0)
	Jinja2 (2.9.5)
	jsonschema (2.6.0)
	jupyter-client (5.0.0)
	jupyter-core (4.3.0)
	jupyterhub (0.8.0.dev0, /Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub)
	Mako (1.0.6)
	MarkupSafe (0.23)
	mistune (0.7.3)
	mock (2.0.0)
	nbconvert (5.1.1)
	nbformat (4.3.0)
	notebook (4.4.1)
	pamela (0.3.0)
	pandocfilters (1.4.1)
	pbr (1.10.0)
	pexpect (4.2.1)
	pickleshare (0.7.4)
	pip (8.1.1)
	prompt-toolkit (1.0.13)
	ptyprocess (0.5.1)
	py (1.4.32)
	Pygments (2.2.0)
	pytest (3.0.6)
	pytest-cov (2.4.0)
	pytest-tornado (0.4.5)
	python-dateutil (2.6.0)
	python-editor (1.0.3)
	pyzmq (16.0.2)
	requests (2.13.0)
	requests-mock (1.3.0)
	setuptools (20.10.1)
	simplegeneric (0.8.1)
	six (1.10.0)
	SQLAlchemy (1.1.5)
	terminado (0.6)
	testpath (0.3)
	tornado (4.4.2)
	traitlets (4.3.2)
	wcwidth (0.1.7)
(myenv) 

PS: I am contributing as part of hackillinois 2017, where @willingc is mentoring here :)

@minrk
Copy link
Member

minrk commented Feb 26, 2017

Does it work if you delete this file: /Users/nicky/sandbox/hackillinois2017/jupyter/jupyterhub/jupyterhub_cookie_secret ?

I am contributing as part of hackillinois 2017, where @willingc is mentoring here :)

Great! welcome to the project. Happy hacking!

@nickylimjj
Copy link
Author

It worked! Thank you! I am thinking of adding that short note to the contributing guidelines if that sounds good. Creating the virtual environment really did the trick.

@willingc
Copy link
Contributor

@nickylimjj Would you add the error and its resolution to the troubleshooting section of the docs? The file to edit is https://github.com/jupyterhub/jupyterhub/blob/master/docs/source/troubleshooting.md. Adding to the contributing guidelines would be helpful too.

Thanks @minrk for the troubleshooting help too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants