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.

[BUG] Jupyter as subdependency is not installed correctly

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Windows 10

  • Poetry version: 1.1.4

Issue

I am using a repository as a meta module, containing all dependencies needed for multiple other projects (which are interlinked). I then proceed to install the dependencies from another repository.

The dependencies toml looks like this:

[tool.poetry.dependencies]
python = "^3.7"
dynaconf = "^3.1.2"
numpy = "^1.19.4"
pandas = "^1.1.4"
scikit-learn = "^0.23.2"
dask = { extras = ["complete"], version = "^2.30.0" }
scipy = "^1.5.4"
tqdm = "^4.52.0"
plotly = "^4.12.0"
kaleido = "^0.0.3"
pyarrow = "^2.0.0"
matplotlib = "^3.3.3"
seaborn = "^0.11.0"
onnx = "^1.8.0"
onnxruntime = "^1.5.2"
pyyaml = "^5.3.1"
skl2onnx = "^1.7.0"
pylint = "^2.6.0"
flake8 = "^3.8.4"
isort = "^5.6.4"
seed-isort-config = "^2.2.0"
black = "^20.8b1"
pre-commit = "^2.8.2"
pytest-cov = "^2.10.1"
pytest = "^6.1.2"
notebook = "^6.1.5"
jupyterlab = "^2.2.9"
ipywidgets = "^7.5.1"
ipdb = "^0.13.4"
openpyxl = "^3.0.5"
jupyter = "^1.0.0"

and i install in other repos through

[tool.poetry.dependencies]
dsdependencies = { git = "somegitlink", rev = "develop" }
python = "^3.7"

In both the dependencies env and the other package env, poetry show lists all packages correctly (only difference is the dsdependencies repo):

appdirs               1.4.4         A small Python module for determining appropriate platform-specific dirs, e....
argon2-cffi           20.1.0        The secure Argon2 password hashing algorithm.
aspy.refactor-imports 2.1.1         Utilities for refactoring imports in python-like syntax.
astroid               2.4.2         An abstract syntax tree for Python with inference support.
async-generator       1.10          Async generators and context managers for Python 3.5+
atomicwrites          1.4.0         Atomic file writes.
attrs                 20.3.0        Classes Without Boilerplate
backcall              0.2.0         Specifications for callback functions passed in to an API
black                 20.8b1        The uncompromising code formatter.
bleach                3.2.1         An easy safelist-based HTML-sanitizing tool.
bokeh                 2.2.3         Interactive plots and applications in the browser from Python
cached-property       1.5.2         A decorator for caching properties in classes.
certifi               2020.11.8     Python package for providing Mozilla's CA Bundle.
cffi                  1.14.3        Foreign Function Interface for Python calling C code.
cfgv                  3.2.0         Validate configuration and produce human readable error messages.
chardet               3.0.4         Universal encoding detector for Python 2 and 3
click                 7.1.2         Composable command line interface toolkit
cloudpickle           1.6.0         Extended pickling support for Python objects
colorama              0.4.4         Cross-platform colored terminal text.
coverage              5.3           Code coverage measurement for Python
cycler                0.10.0        Composable style cycles
dask                  2.30.0        Parallel PyData with Task Scheduling
decorator             4.4.2         Decorators for Humans
defusedxml            0.6.0         XML bomb protection for Python stdlib modules
distlib               0.3.1         Distribution utilities
distributed           2.30.1        Distributed scheduler for Dask
dsdependencies        0.1.0 ba1f762 Organize dependencies
dynaconf              3.1.2         The dynamic configurator for your Python Project
entrypoints           0.3           Discover and load entry points from installed packages.
et-xmlfile            1.0.1         An implementation of lxml.xmlfile for the standard library
filelock              3.0.12        A platform independent file lock.
flake8                3.8.4         the modular source code checker: pep8 pyflakes and co
fsspec                0.8.4         File-system specification
heapdict              1.0.1         a heap with decrease-key and increase-key operations
identify              1.5.9         File identification library for Python
idna                  2.10          Internationalized Domain Names in Applications (IDNA)
importlib-metadata    2.0.0         Read metadata from Python packages
iniconfig             1.1.1         iniconfig: brain-dead simple config-ini parsing
ipdb                  0.13.4        IPython-enabled pdb
ipykernel             5.3.4         IPython Kernel for Jupyter
ipython               7.19.0        IPython: Productive Interactive Computing
ipython-genutils      0.2.0         Vestigial utilities from IPython
ipywidgets            7.5.1         IPython HTML widgets for Jupyter
isort                 5.6.4         A Python utility / library to sort Python imports.
jdcal                 1.4.1         Julian dates from proleptic Gregorian and Julian calendars.
jedi                  0.17.2        An autocompletion tool for Python that can be used for text editors.
jinja2                2.11.2        A very fast and expressive template engine.
joblib                0.17.0        Lightweight pipelining: using Python functions as pipeline jobs.
json5                 0.9.5         A Python implementation of the JSON5 data format.
jsonschema            3.2.0         An implementation of JSON Schema validation for Python
jupyter               1.0.0         Jupyter metapackage. Install all the Jupyter components in one go.
jupyter-client        6.1.7         Jupyter protocol implementation and client libraries
jupyter-console       6.2.0         Jupyter terminal console
jupyter-core          4.7.0         Jupyter core package. A base package on which Jupyter projects rely.
jupyterlab            2.2.9         The JupyterLab notebook server extension.
jupyterlab-pygments   0.1.2         Pygments theme using JupyterLab CSS variables
jupyterlab-server     1.2.0         JupyterLab Server
kaleido               0.0.3.post1   Static image export for web-based visualization libraries with zero dependen...
kiwisolver            1.3.1         A fast implementation of the Cassowary constraint solver
lazy-object-proxy     1.4.3         A fast and thorough lazy object proxy.
locket                0.2.0         File-based locks for Python for Linux and Windows
markupsafe            1.1.1         Safely add untrusted strings to HTML/XML markup.
matplotlib            3.3.3         Python plotting package
mccabe                0.6.1         McCabe checker, plugin for flake8
mistune               0.8.4         The fastest markdown parser in pure Python
msgpack               1.0.0         MessagePack (de)serializer.
mypy-extensions       0.4.3         Experimental type system extensions for programs checked with the mypy typec...
nbclient              0.5.1         A client library for executing notebooks. Formerly nbconvert's ExecutePrepro...
nbconvert             6.0.7         Converting Jupyter Notebooks
nbformat              5.0.8         The Jupyter Notebook format
nest-asyncio          1.4.3         Patch asyncio to allow nested event loops
nodeenv               1.5.0         Node.js virtual environment builder
notebook              6.1.5         A web-based notebook environment for interactive computing
numpy                 1.19.4        NumPy is the fundamental package for array computing with Python.
onnx                  1.8.0         Open Neural Network Exchange
onnxconverter-common  1.7.0         ONNX Converter and Optimization Tools
onnxruntime           1.5.2         ONNX Runtime Python bindings
openpyxl              3.0.5         A Python library to read/write Excel 2010 xlsx/xlsm files
packaging             20.4          Core utilities for Python packages
pandas                1.1.4         Powerful data structures for data analysis, time series, and statistics
pandocfilters         1.4.3         Utilities for writing pandoc filters in python
parso                 0.7.1         A Python Parser
partd                 1.1.0         Appendable key-value storage
pathspec              0.8.1         Utility library for gitignore style pattern matching of file paths.
pickleshare           0.7.5         Tiny 'shelve'-like database with concurrency support
pillow                8.0.1         Python Imaging Library (Fork)
plotly                4.12.0        An open-source, interactive data visualization library for Python
pluggy                0.13.1        plugin and hook calling mechanisms for python
pre-commit            2.8.2         A framework for managing and maintaining multi-language pre-commit hooks.
prometheus-client     0.9.0         Python client for the Prometheus monitoring system.
prompt-toolkit        3.0.8         Library for building powerful interactive command lines in Python
protobuf              3.14.0        Protocol Buffers
psutil                5.7.3         Cross-platform lib for process and system monitoring in Python.
py                    1.9.0         library with cross-python path, ini-parsing, io, code, log facilities
pyarrow               2.0.0         Python library for Apache Arrow
pycodestyle           2.6.0         Python style guide checker
pycparser             2.20          C parser in Python
pyflakes              2.2.0         passive checker of Python programs
pygments              2.7.2         Pygments is a syntax highlighting package written in Python.
pylint                2.6.0         python code static checker
pyparsing             2.4.7         Python parsing module
pyrsistent            0.17.3        Persistent/Functional/Immutable data structures
pytest                6.1.2         pytest: simple powerful testing with Python
pytest-cov            2.10.1        Pytest plugin for measuring coverage.
python-dateutil       2.8.1         Extensions to the standard Python datetime module
pytz                  2020.4        World timezone definitions, modern and historical
pywin32               300           Python for Window Extensions
pywinpty              0.5.7         Python bindings for the winpty library
pyyaml                5.3.1         YAML parser and emitter for Python
pyzmq                 20.0.0        Python bindings for 0MQ
qtconsole             4.7.7         Jupyter Qt console
qtpy                  1.9.0         Provides an abstraction layer on top of the various Qt bindings (PyQt5, PyQt...
regex                 2020.11.13    Alternative regular expression module, to replace re.
requests              2.25.0        Python HTTP for Humans.
retrying              1.3.3         Retrying
scikit-learn          0.23.2        A set of python modules for machine learning and data mining
scipy                 1.5.4         SciPy: Scientific Library for Python
seaborn               0.11.0        seaborn: statistical data visualization
seed-isort-config     2.2.0         Statically populate the `known_third_party` `isort` setting.
send2trash            1.5.0         Send file to trash natively under Mac OS X, Windows and Linux.
six                   1.15.0        Python 2 and 3 compatibility utilities
skl2onnx              1.7.0         Convert scikit-learn models to ONNX
sortedcontainers      2.3.0         Sorted Containers -- Sorted List, Sorted Dict, Sorted Set
tblib                 1.7.0         Traceback serialization library.
terminado             0.9.1         Tornado websocket backend for the Xterm.js Javascript terminal emulator libr...
testpath              0.4.4         Test utilities for code working with files and commands
threadpoolctl         2.1.0         threadpoolctl
toml                  0.10.2        Python Library for Tom's Obvious, Minimal Language
toolz                 0.11.1        List processing tools and functional utilities
tornado               6.1           Tornado is a Python web framework and asynchronous networking library, origi...
tqdm                  4.52.0        Fast, Extensible Progress Meter
traitlets             5.0.5         Traitlets Python configuration system
typed-ast             1.4.1         a fork of Python 2 and 3 ast modules with type comment support
typing-extensions     3.7.4.3       Backported and Experimental Type Hints for Python 3.5+
urllib3               1.26.2        HTTP library with thread-safe connection pooling, file post, and more.
virtualenv            20.1.0        Virtual Python Environment builder
wcwidth               0.2.5         Measures the displayed width of unicode strings in a terminal
webencodings          0.5.1         Character encoding aliases for legacy web content
widgetsnbextension    3.5.1         IPython HTML widgets for Jupyter
wrapt                 1.12.1        Module for decorators, wrappers and monkey patching.
zict                  2.0.0         Mutable mapping tools
zipp                  3.4.0         Backport of pathlib-compatible object wrapper for zip files

Including, specifically

λ poetry show pyrsistent
name         : pyrsistent
version      : 0.17.3
description  : Persistent/Functional/Immutable data structures

However, when I run

poetry run jupyter notebook

it produces an error in the package utilizing the dependency package

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\...\AppData\Local\pypoetry\Cache\virtualenvs\dscustomerdatahandler-2UNjZCmJ-py3.7\Scripts\jupyter-notebook.EXE\__main__.py", line 4, in <module>
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\notebook\notebookapp.py", line 85, in <module>
    from .services.contents.manager import ContentsManager
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\nbformat\__init__.py", line 32, in <module>
    from .validator import validate, ValidationError
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\nbformat\validator.py", line 12, in <module>
    from .json_compat import get_current_validator, ValidationError
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\nbformat\json_compat.py", line 10, in <module>
    import jsonschema
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\jsonschema\__init__.py", line 21, in <module>
    from jsonschema._types import TypeChecker
  File "c:\users\...\appdata\local\pypoetry\cache\virtualenvs\dscustomerdatahandler-2unjzcmj-py3.7\lib\site-packages\jsonschema\_types.py", line 3, in <module>
    from pyrsistent import pmap
ModuleNotFoundError: No module named 'pyrsistent'

When run directly in the dependencies package, it works just fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
klnrdkntcommented, Nov 19, 2020

It worked, thanks!

1reaction
klnrdkntcommented, Nov 19, 2020

I’ll delete the folder and the poetry.lock and reinstall, then get back to you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do when things go wrong - The Jupyter Notebook
If Jupyter gives an error that it can't find notebook , check with pip or conda ... If libraries like pywin32 are not...
Read more >
How to fix errors occurring on installation of Jupyter Notebook
Go to your python.exe (for example, my way is C:\Users\user\AppData\Local\Programs\Python\Python37) - just for sure; python.exe python -m pip  ...
Read more >
Dependency Resolution - pip documentation v22.3.1
The process of determining which version of a dependency to install is known as dependency resolution. This behaviour can be disabled by passing...
Read more >
The Nine Circles of Python Dependency Hell - Medium
Dependency hell in Python often happens because pip does not have a dependency… ... runtime error because the wrong version of a library...
Read more >
Build "can not execute setup.py since setuptools is not available"
Installing dependencies from lock file Warning: The lock file is not up to date with the latest ... python setup.py egg_info did not...
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