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.

how to debug mach-nix

See original GitHub issue

I would like to install pkgs but in combination there are different issues

  • how can I debug those with mach-nix
let
   mach-nix = import (builtins.fetchGit {
     url = "https://github.com/DavHau/mach-nix/";
     ref = "refs/tags/2.2.2";
     rev = "f0b3b3c8e5153f61db7dcfbe2120c8d3e0e41371";
   }); 

  overlays = []; # some very useful overlays
  pkgs = import mach-nix.nixpkgs.path { config = { allowUnfree = true; }; inherit overlays; };
in mach-nix.mkPythonShell rec {
  python = pkgs.python37;
  requirements =  ''  
    aiohttp 
    arcgis 
    area 
    asyncio 
    autoflake 
    #avro 
    black
    bokeh 
    bottle 
    chart-studio 
    clang 
    conda 
    cython
    dash 
    dash-leaflet 
    dask 
    #dbt 
    #dephell 
    descartes 
    django 
    earthengine-api 
    eli5 
    fastapi 
    Fiona 
    flake8 
    flask 
    folium 
    fuzzywuzzy
    GeoAlchemy2 
    geofeather 
    geojsonio 
    geopandas 
    geopy 
    geotable 
    gprof2dot 
    graphviz 
    h2o 
    holoviews 
    hunter 
    hvplot 
    imbalanced-learn 
    ipdb 
    ipyparallel 
    ipython 
    ipywidgets 
    pythreejs
    jq 
    json2json 
    json2yaml 
    jupyter_contrib_nbextensions 
    #jupyterhub 
    jupyterlab>=2.2.0
    jupyter_nbextensions_configurator 
    lidar 
    lime 
    line-profiler 
    Markdown 
    missingno 
    momepy 
    more-itertools 
    mypy 
    networkx 
    #Nikola # issues 
    objgraph 
    ogr2wkt 
    openpyxl 
    orange3 
    osmapi 
    osm-diff-tool 
    osmnet 
    overpass 
    #overpy2 
    pandana 
    pandas 
    streamz
    #panel 
    parquet 
    pip 
    pip-tools 
    pipx 
    #plop 
    plotly 
    #poetry2conda 
    pprint 
    pprofile 
    #pyarrow 
    #pycsw 
    pydal 
    pygeos
    pygis 
    pygments 
    pyinstrument 
    pymc3 
    Pympler 
    pyperf 
    pyproj 
    pyshp 
    py-spy 
    pytest 
    #pywps 
    quinn 
    rasterio 
    rasterstats 
    recurse 
    reportlab 
    #rio-cogeo 
    #rsgis 
    scikit-learn 
    seaborn 
    shap 
    Shapely 
    simplejson 
    spatial 
    stackimpact 
    tensorflow 
    tifffile 
    torch 
    tqdm 
    tuna 
    urbansim 
    verde 
    VisiData 
    # voila 
    vprof 
    #whitebox 
    widgetsnbextension 
    xarray 
    #xarray-spatial 
    xdot 
    xgboost 
    XlsxWriter 
    fuzzywuzzy
    spacy
    nltk 
    gensim
    #word2vec 
    quepy 
    textblob 
    Pattern 
    PyNLPl 
    corenlp
    #polyglot
    keplergl
    mapboxgl
    #osmnx   
    urbanpy 
    earthpy
    pysal
    gdal 
    xarray-leaflet
    #pypostal
    #vaex-jupyter
    pickle5
    pylint
    jupyterlab_pygments  
    jupyterlab_code_formatter  
    #libxml2python3
    nbresuse
    jupyterlab-git
    pyfxa
    pycrypto
    scikit-image
    ipykernel
    nbdime
    ipyleaflet
    jupyterlab_gitlab
    jupyterlab_latex
    isort
    jupyterlab_code_formatter
    jupyter_bokeh
    ipysheet
    xeus-python
    ptvsd
    pydevd-pycharm
    pylantern
    jupyterlab_commands
    ipympl
    jupyter-lsp  
    jupyter-kite
    ipymonaco
    jupyter-kite
    '';
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
DavHaucommented, Aug 21, 2020

Alright, now I got you 😉 Sadly ResolutionTooDeep errors are a bit difficult to understand currently, since the underlying resolvelib library doesn’t reveal a lot of info when it raises the error. I think in general it means that the algorithm could not solve a dependency even after iterating 1000 times on it. One could increase the number of iterations, but from my experience it doesn’t help to increase it to more than 1000.

You can check resolvelib here: https://github.com/sarugaku/resolvelib It’s a realtively young project. Mach-nix is currently using version 0.3.0 .

But it is not feasible to test all combinations of all packages, right?

It’s not feasible since python packages specify their dependencies as ranges. Therefore as soon as you have more than a few packages the amount of possible resolution results is basically endless.

In general if you’d really like to debug mach-nix with a debugger, then check ./debug/debug.py. This just executes the resolution on a given requirement.txt . You can easily attach a debugger of your choice. This is what I’m mostly doing to hunt bugs.

Upgrading resolvelib to a newer version would be a great thing to do. It seems like there is not much going on anymore in their github repo since the project got merged into pip. It would be nice to contact one of their developers and ask about the status. I hope they will merge their work on pip also into the standalone resolvelib project, so others can benefit.

0reactions
DavHaucommented, Aug 26, 2020

You environments builds with the newest version (2.3.0) if I remove pprint which has been deleted from pypi and add the following provider config:

  providers = {
    numpy = "nixpkgs";
    orange3 = "sdist";
  };
Read more comments on GitHub >

github_iconTop Results From Across the Web

mach-nix - Create highly reproducible python environments
Mach-nix makes it easy to create and share reproducible python environments or packages. Existing tools for python package management often suffer from ...
Read more >
I'm stuck! How to efficiently debug computational solid ... - arXiv
I'm stuck! How to efficiently debug computational solid mechanics models so you can enjoy the beauty of simulations. Authors:Ester Comellas, ...
Read more >
Debug Mechanics | Fallout Who Vegas Wiki - Fandom
The debug mode can be used to "cheat" your way through the mod. Features include: You can add every location to the TARDIS...
Read more >
Mach-nix: Create python environments quick and easy
You can make an overlay for nixpkgs which replaces python39 with your debugging python. Then import nixpkgs with that overlay and pass it...
Read more >
I'm stuck! How to efficiently debug computational solid ...
Debugging is an integral part of developing successful computational models. •. We describe the components of a computational solid mechanics model and ...
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