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.

module 'lazr' breaks pydeps

See original GitHub issue

Tested on Linux, Ubuntu 20.04.

Consider this oneliner test program test_pydeps.py:

import lazr

Run pydeps on it. It will give an enormous stacktrace, this is the tail:

  File "/home/jan/.local/lib/python3.8/site-packages/pydeps/py2depgraph.py", line 139, in import_module
    module = mf27.ModuleFinder.import_module(self, partnam, fqname, parent)
  File "/usr/lib/python3.8/modulefinder.py", line 318, in import_module
    fp, pathname, stuff = self.find_module(partname,
  File "/usr/lib/python3.8/modulefinder.py", line 510, in find_module
    return _find_module(name, path)
  File "/usr/lib/python3.8/modulefinder.py", line 79, in _find_module
    if spec.loader.is_package(name):
AttributeError: 'NoneType' object has no attribute 'is_package'

Excepted result: a more descriptive error or warning, mentioning lazr, perhaps guiding the user to exclude it?

I ran into this problem when I tried to analyze my own project. Had to sprinkle some print statements in pydeps to figure out that lazr was the problem.

Workaround which works fine for me: just exclude lazr.

PS: I have no clue what lazr is, how it found its way onto my system, and why it is so special for pydeps; I just happen to implicitly use it in my project.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
janfeitsmacommented, Apr 21, 2022

Solved indeed, many thanks!

0reactions
thebjorncommented, Apr 21, 2022

This should be fixed in the latest version (v1.10.17) available on PyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pydeps - Visualizes Python module dependencies. - GitHub
Visualizes dependencies between Python modules. Usage. Just run the pydeps.py command with a path to a directory containing Python source files.
Read more >
pydeps — pydeps 1.11.0 documentation
Python module dependency visualization. This package is primarly intended to be used from the command line through the pydeps command. Contents. pydeps.
Read more >
pydeps fails to generate dependency graph - python
I'm attempting to use the Python module pydeps (installed with mamba install pydeps ) to analyze the dependencies in my project.
Read more >
devel/py-setuptools: Python packages installer - FreshPorts
Setuptools is a fully-featured, actively-maintained, and stable library designed to facilitate packaging Python projects, where packaging includes: - Python ...
Read more >
Simple index - piwheels
... xxxy-test mitoinstall prespy repo-gist-sync psap inmanta-module-dummy-module odoo13-addon-partner-contact-gender python-google-image-search pypiwrapper ...
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