question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble running tests with provided conda env

See original GitHub issue

I’m having trouble running the tests locally using the provided conda environment. The environment was created following the instructions in the readme:

conda env create --name datashader --file ./examples/environment.yml
conda activate datashader
pip install -e .
pytest

pytest immediately fails with the following traceback:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/_pytest/main.py", line 206, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/_pytest/config/__init__.py", line 639, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/hooks.py", line 311, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pytest_benchmark/plugin.py", line 1092, in pytest_configure
INTERNALERROR>     config._benchmarksession = BenchmarkSession(config)
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pytest_benchmark/plugin.py", line 568, in __init__
INTERNALERROR>     self.logger = Logger(self.verbose, config)
INTERNALERROR>   File "/Users/isaac/miniconda3/envs/datashader/lib/python3.6/site-packages/pytest_benchmark/plugin.py", line 519, in __init__
INTERNALERROR>     self.pytest_warn = config.warn
INTERNALERROR> AttributeError: 'Config' object has no attribute 'warn'

I was able to get tests partially running under a different environment which doesn’t have pytest-benchmark installed.

This is using the latest master (3171d8869f63214cc161da755e88c30abe8b5098) with macOS v10.14.3.

Output of `conda list`
# packages in environment at /Users/isaac/miniconda3/envs/datashader:
#
# Name                    Version                   Build  Channel
affine                    2.2.2                      py_0    conda-forge
antlr-python-runtime      4.7.2                 py36_1000    conda-forge
appnope                   0.1.0                 py36_1000    conda-forge
asn1crypto                0.24.0                py36_1003    conda-forge
atomicwrites              1.3.0                      py_0    conda-forge
attrs                     19.1.0                     py_0    conda-forge
backcall                  0.1.0                      py_0    conda-forge
beautifulsoup4            4.7.1                 py36_1001    conda-forge
blas                      1.1                    openblas    conda-forge
bleach                    3.1.0                      py_0    conda-forge
blosc                     1.16.3               h0a44026_0    conda-forge
bokeh                     1.0.4                 py36_1000    conda-forge
boost-cpp                 1.68.0            h6f8c590_1000    conda-forge
bzip2                     1.0.6             h1de35cc_1002    conda-forge
ca-certificates           2019.3.9             hecc5488_0    conda-forge
cachey                    0.1.1                    pypi_0    pypi
cairo                     1.16.0            h9247486_1000    conda-forge
cartopy                   0.17.0          py36h929c6f0_1004    conda-forge
certifi                   2019.3.9                 py36_0    conda-forge
cf-units                  2.1.1           py36h917ab60_1000    conda-forge
cffi                      1.12.2           py36h2d6ddff_1    conda-forge
cftime                    1.0.3.4         py36h917ab60_1000    conda-forge
chardet                   3.0.4                 py36_1003    conda-forge
click                     7.0                        py_0    conda-forge
click-plugins             1.0.4                      py_0    conda-forge
cligj                     0.5.0                      py_0    conda-forge
cloudpickle               0.8.0                      py_0    conda-forge
colorcet                  1.0.0                      py_0    conda-forge
cryptography              2.5              py36hdbc3d79_1    conda-forge
curl                      7.64.0               heae2a1f_0    conda-forge
cycler                    0.10.0                     py_1    conda-forge
cytoolz                   0.9.0.1         py36h1de35cc_1001    conda-forge
dask                      1.1.4                      py_0    conda-forge
dask-core                 1.1.4                      py_0    conda-forge
datashader                0.7.0a1.post4+g3171d88           dev_0    <develop>
datashape                 0.5.4                      py_1    conda-forge
decorator                 4.3.2                      py_0    conda-forge
defusedxml                0.5.0                      py_1    conda-forge
descartes                 1.1.0                      py_2    conda-forge
dill                      0.2.9                    py36_0    conda-forge
distributed               1.26.0                   py36_1    conda-forge
entrypoints               0.3                   py36_1000    conda-forge
expat                     2.2.5             h0a44026_1002    conda-forge
fastparquet               0.2.1           py36h917ab60_1001    conda-forge
fiona                     1.8.4           py36h0e3174d_1002    conda-forge
flake8                    3.7.7                    py36_0    conda-forge
fontconfig                2.13.1            h1e4e890_1000    conda-forge
freetype                  2.9.1             h597ad8a_1005    conda-forge
freexl                    1.0.5             h1de35cc_1002    conda-forge
gdal                      2.4.0           py36h0e3174d_1002    conda-forge
geopandas                 0.4.1                      py_0    conda-forge
geos                      3.7.1             h0a44026_1000    conda-forge
geotiff                   1.4.3             hce09ea4_1000    conda-forge
geoviews                  1.6.2                      py_0    conda-forge
geoviews-core             1.6.2                      py_0    conda-forge
gettext                   0.19.8.1          hcca000d_1001    conda-forge
giflib                    5.1.4             h1de35cc_1001    conda-forge
glib                      2.58.3            h2836805_1001    conda-forge
graphviz                  2.38.0            hc6cc99f_1011    conda-forge
hdf4                      4.2.13            hf3c6af0_1002    conda-forge
hdf5                      1.10.4          nompi_h646315f_1105    conda-forge
heapdict                  1.0.0                 py36_1000    conda-forge
holoviews                 1.11.3                     py_0    pyviz/label/dev
icu                       58.2              h0a44026_1000    conda-forge
idna                      2.8                   py36_1000    conda-forge
imageio                   2.4.1                 py36_1000    conda-forge
ipykernel                 5.1.0           py36h24bf2e0_1002    conda-forge
ipython                   7.1.1           py36h24bf2e0_1000    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.4.2                      py_0    conda-forge
iris                      2.2.0                 py36_1003    conda-forge
jedi                      0.13.3                   py36_0    conda-forge
jinja2                    2.10                       py_1    conda-forge
jpeg                      9c                h1de35cc_1001    conda-forge
json-c                    0.13.1            h1de35cc_1001    conda-forge
jsonschema                3.0.1                    py36_0    conda-forge
jupyter                   1.0.0                      py_1    conda-forge
jupyter_client            5.2.4                      py_3    conda-forge
jupyter_console           6.0.0                      py_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
jupyter_dashboards        0.7.0                 py36_1000    conda-forge
kealib                    1.4.10            hf5ed860_1002    conda-forge
kiwisolver                1.0.1           py36h04f5b5a_1002    conda-forge
krb5                      1.16.3            h24a3359_1000    conda-forge
libcurl                   7.64.0               h76de61e_0    conda-forge
libcxx                    7.0.0                h2d50403_1    conda-forge
libdap4                   3.19.1            hae55d67_1000    conda-forge
libedit                   3.1.20170329      hcfe32e1_1001    conda-forge
libffi                    3.2.1             h0a44026_1005    conda-forge
libgdal                   2.4.0             h89caebc_1002    conda-forge
libgfortran               3.0.1                         0    conda-forge
libiconv                  1.15              h1de35cc_1004    conda-forge
libkml                    1.3.0             h71ee1b2_1009    conda-forge
libnetcdf                 4.6.2             h6b88ef6_1001    conda-forge
libpng                    1.6.36            ha441bb4_1000    conda-forge
libpq                     10.6              hbe1e24e_1000    conda-forge
libsodium                 1.0.16            h1de35cc_1001    conda-forge
libspatialindex           1.8.5             h0a44026_1003    conda-forge
libspatialite             4.3.0a            h0cd9627_1026    conda-forge
libssh2                   1.8.0             hf30b1f0_1003    conda-forge
libtiff                   4.0.10            h79f4b77_1001    conda-forge
libxml2                   2.9.8             hf14e9c8_1005    conda-forge
libxslt                   1.1.32            h33a18ac_1002    conda-forge
llvm-meta                 7.0.0                         0    conda-forge
llvmlite                  0.26.0          py36h3fea490_1000    conda-forge
locket                    0.2.0                      py_2    conda-forge
lxml                      4.3.2            py36h7166777_0    conda-forge
mapclassify               2.0.1                      py_0    conda-forge
markupsafe                1.1.1            py36h1de35cc_0    conda-forge
marshmallow               2.19.0                   pypi_0    pypi
matplotlib                3.0.3                    py36_0    conda-forge
matplotlib-base           3.0.3            py36hf043ca5_0    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.4           py36h1de35cc_1000    conda-forge
more-itertools            4.3.0                 py36_1000    conda-forge
msgpack-python            0.6.1            py36h04f5b5a_0    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
munch                     2.3.2                      py_0    conda-forge
nbconvert                 5.4.1                      py_2    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
ncurses                   6.1               h0a44026_1002    conda-forge
netcdf4                   1.4.3.2          py36hf8bc7f3_0    conda-forge
networkx                  2.2                        py_1    conda-forge
notebook                  5.7.5                    py36_0    conda-forge
numba                     0.41.0          py36h1702cab_1000    conda-forge
numexpr                   2.6.9           py36h1702cab_1000    conda-forge
numpy                     1.16.2          py36_blas_openblash486cb9f_0  [blas_openblas]  conda-forge
olefile                   0.46                       py_0    conda-forge
openblas                  0.3.3             hdc02c5d_1001    conda-forge
openjpeg                  2.3.0             h3bf0609_1003    conda-forge
openssl                   1.0.2r               h1de35cc_0    conda-forge
owslib                    0.17.1                     py_0    conda-forge
packaging                 19.0                       py_0    conda-forge
pandas                    0.24.1           py36h0a44026_0    conda-forge
pandoc                    2.6                           1    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
param                     1.8.2                      py_0    conda-forge
paramnb                   2.0.4                      py_0    conda-forge
parso                     0.3.4                      py_0    conda-forge
partd                     0.3.9                      py_0    conda-forge
patsy                     0.5.1                      py_0    conda-forge
pcre                      8.41              h0a44026_1003    conda-forge
pexpect                   4.6.0                 py36_1000    conda-forge
pickleshare               0.7.5                 py36_1000    conda-forge
pillow                    5.4.1           py36hbddbef0_1000    conda-forge
pip                       19.0.3                   py36_0    conda-forge
pixman                    0.34.0            h1de35cc_1003    conda-forge
pluggy                    0.9.0                      py_0    conda-forge
poppler                   0.67.0               hb974355_6    conda-forge
poppler-data              0.4.9                         1    conda-forge
postgresql                10.6              ha1bbaa7_1000    conda-forge
proj4                     5.2.0             h1de35cc_1001    conda-forge
prometheus_client         0.6.0                      py_0    conda-forge
prompt_toolkit            2.0.9                      py_0    conda-forge
psutil                    5.6.0            py36h1de35cc_0    conda-forge
ptyprocess                0.6.0                 py36_1000    conda-forge
py                        1.8.0                      py_0    conda-forge
pycodestyle               2.5.0                      py_0    conda-forge
pycparser                 2.19                       py_0    conda-forge
pyct                      0.4.6                      py_0    conda-forge
pyct-core                 0.4.6                      py_0    conda-forge
pyepsg                    0.4.0                      py_0    conda-forge
pyflakes                  2.1.1                      py_0    conda-forge
pygments                  2.3.1                      py_0    conda-forge
pykdtree                  1.3.1           py36h917ab60_1002    conda-forge
pyke                      1.1.1                 py36_1000    conda-forge
pyopenssl                 19.0.0                   py36_0    conda-forge
pyparsing                 2.3.1                      py_0    conda-forge
pyproj                    1.9.6           py36h9c430a6_1000    conda-forge
pyqt                      5.6.0           py36hc26a216_1008    conda-forge
pyrsistent                0.14.11          py36h1de35cc_0    conda-forge
pyshp                     2.1.0                      py_0    conda-forge
pysocks                   1.6.8                 py36_1002    conda-forge
pytables                  3.4.4           py36h0af8b44_1004    conda-forge
pytest                    4.3.0                    py36_0    conda-forge
pytest-benchmark          3.0.0                 py36_1001    conda-forge
python                    3.6.7             h4a56312_1002    conda-forge
python-dateutil           2.8.0                      py_0    conda-forge
python-graphviz           0.10.1                     py_0    conda-forge
python-snappy             0.5.3           py36h8522eec_1000    conda-forge
pytz                      2018.9                     py_0    conda-forge
pyviz_comms               0.7.0                      py_0    conda-forge
pywavelets                1.0.2            py36h917ab60_0    conda-forge
pyyaml                    3.13            py36h1de35cc_1001    conda-forge
pyzmq                     18.0.1           py36h4cc6ddd_0    conda-forge
qt                        5.6.2             h822fa55_1013    conda-forge
qtconsole                 4.4.3                      py_0    conda-forge
rasterio                  1.0.21           py36h3683dd5_0    conda-forge
readline                  7.0               hcfe32e1_1001    conda-forge
requests                  2.21.0                py36_1000    conda-forge
rtree                     0.8.3                 py36_1000    conda-forge
scikit-image              0.14.2           py36h0a44026_1    conda-forge
scipy                     1.2.1           py36_blas_openblash486cb9f_0  [blas_openblas]  conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                40.8.0                   py36_0    conda-forge
shapely                   1.6.4           py36h2bcc7ef_1002    conda-forge
sip                       4.18.1          py36h0a44026_1000    conda-forge
six                       1.12.0                py36_1000    conda-forge
snappy                    1.1.7             h0a44026_1002    conda-forge
snuggs                    1.4.3                      py_0    conda-forge
sortedcontainers          2.1.0                      py_0    conda-forge
soupsieve                 1.8                      py36_0    conda-forge
sqlite                    3.26.0            h1765d9f_1001    conda-forge
statsmodels               0.9.0           py36h917ab60_1000    conda-forge
streamz                   0.2.0                    pypi_0    pypi
tblib                     1.3.2                      py_1    conda-forge
terminado                 0.8.1                 py36_1001    conda-forge
testpath                  0.3.1                    pypi_0    pypi
thrift                    0.11.0          py36h0a44026_1001    conda-forge
tk                        8.6.9             ha441bb4_1000    conda-forge
toolz                     0.9.0                      py_1    conda-forge
tornado                   6.0.1            py36h1de35cc_0    conda-forge
traitlets                 4.3.2                 py36_1000    conda-forge
tzcode                    2018g             h1de35cc_1001    conda-forge
udunits2                  2.2.27.6          h776b7f1_1001    conda-forge
urllib3                   1.24.1                py36_1000    conda-forge
wcwidth                   0.1.7                      py_1    conda-forge
webargs                   5.1.2                    pypi_0    pypi
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.33.1                   py36_0    conda-forge
widgetsnbextension        3.4.2                 py36_1000    conda-forge
xarray                    0.11.3                   py36_0    conda-forge
xerces-c                  3.2.2             h44e365a_1001    conda-forge
xz                        5.2.4             h1de35cc_1001    conda-forge
yaml                      0.1.7             h1de35cc_1001    conda-forge
zeromq                    4.2.5             h0a44026_1006    conda-forge
zict                      0.1.4                      py_0    conda-forge
zlib                      1.2.11            h1de35cc_1004    conda-forge

Thanks for any help!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ianthomas23commented, Aug 4, 2022

I understand now!

I think your approach is absolutely fine now. My default approach is even simpler, just a pip install -e .[tests,examples] in a clean virtual environment, which is fine on Linux but may be less so on other platforms.

OK, so plan A is to remove the environment.yml file and not mention pyctdev any more than we already do. I’ll write a PR to do this and update the README with the preferred dev installation process, but before that I will check exactly what does work on the 3 major platforms.

1reaction
jsignellcommented, Mar 13, 2019

I did:

conda create -n datashader -c pyviz/label/dev datashader
conda activate datashader
pip install -e .[tests]

I was getting 12 skips from having a broken version of skimage:

>>> import skimage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jsignell/conda/envs/ds-14/lib/python3.7/site-packages/skimage/__init__.py", line 167, in <module>
    from .util.dtype import (img_as_float32,
  File "/Users/jsignell/conda/envs/ds-14/lib/python3.7/site-packages/skimage/util/__init__.py", line 8, in <module>
    from .arraycrop import crop
  File "/Users/jsignell/conda/envs/ds-14/lib/python3.7/site-packages/skimage/util/arraycrop.py", line 8, in <module>
    from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths' from 'numpy.lib.arraypad' (/Users/jsignell/conda/envs/ds-14/lib/python3.7/site-packages/numpy/lib/arraypad.py)

I upgraded scikit-image to 0.14.2 from conda-forge (conda install -c conda-forge scikit-image=0.14.2) and got 5 skips. Then I got rasterio and am down to 3 skips in collection - but that’s when I saw failures crop up:

datashader/tests/test_raster.py::test_raster_aggregate_default FAILED                                                                                                                                              
datashader/tests/test_raster.py::test_raster_aggregate_nearest FAILED                                                                                                                                               
datashader/tests/test_raster.py::test_partial_extent_returns_correct_size FAILED
datashader/tests/test_raster.py::test_raster_single_pixel_range_with_padding FAILED
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Test Runner Also Has The "new conda run bug" That ...
When I execute my project's unittests using the the Python Test Explorer all tests that depend on packages installed in my Conda environment...
Read more >
Error running tests with Conda and Tox - python - Stack Overflow
I am having trouble running tests with Tox while having virtual environments created with Conda. The steps to reproduce the error are below....
Read more >
Troubleshooting — conda 22.11.1.post13+5eef286ca ...
Run the command conda install -f to unarchive the package again and relink it. It also does an MD5 verification on the package....
Read more >
Contributing packages - Conda-Forge
Tests outside of the package¶. Note that conda-build runs the tests in an isolated environment after installing the package – thus, at this...
Read more >
Python Installation - Conda Install | Google Earth Engine
Print the conda command's help menu to test the Miniconda install. Since Miniconda has not been added to your system's PATH environment variable, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found