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.

Hello Timothy.

I’m getting the following error when running portray as_html command:

portray as_html
/home/me/.virtualenvs/graphene-elastic/lib/python3.6/site-packages/portray/config.py:101: UserWarning: Error (malformed node or string: <_ast.Call object at 0x7f32e20d9c18>) occurred trying to parse setup.py file: /home/me/repos/graphene-elastic/setup.py
  warnings.warn(f"Error ({error}) occurred trying to parse setup.py file: {location}")
Done Copying source documentation to temporary compilation directory
Module not found: graphene-elastic

Virtualenv I’m in has the graphene-elastic installed (python setup.py develop). Installing it using pip install graphene-elastic or python setup.py install does not help.

Is there specific directory structure expected? I run it from the project root here. Anything else I’m missing?

Portray version: portray==1.3.0.

Any tips and help are appreciated. Thanks in advance!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
romanowscommented, May 8, 2020

Just ran into this same error. Someone added a new module to an existing project at foo/bar.py, nothing special, and portray raised the Module not found: foo.bar error. A version of amenezes solution worked for me. Setting PYTHONPATH=. did NOT work but setting PYTHONPATH=foo did make it work.

Given the other debugging comments people have made in this thread make me worry that the PYTHONPATH setting isn’t a real fix. In fact, I would guess that this would break in my project if I ever had two modules with the same name in different packages (e.g. foo.bar and qux.bar).

Edit: I’m going to try changing all of my CI scripts to something like:

PYTHONPATH=$(find . -maxdepth 1 -type d -printf '%p:') portray as_html ...

Which works if your version of find supports -printf. This captures all of the directories in the current working dir including .git directories and the like but seems to work for me.

0reactions
leblancfgcommented, Mar 24, 2020

Same problem here. Unsure if relevant, but it was working a minute ago on Linux w/ Python 3.8; I’m now on macOS w/ Python 3.6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module-not-found - Next.js
The module you're trying to import is not installed in your dependencies · The module you're trying to import is in a different...
Read more >
ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
javascript - Module not found can't resolve - Stack Overflow
app/index.js Module not found: Error: Can't resolve './app/test.js'. I've tried changing the file path to a relative one with no luck and ...
Read more >
Have a JavaScript Module Not Found Error ... - Airbrake Blog
Most likely, the reason you're seeing a “module not found” error message within your JavaScript code will be something simple, like putting an ......
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ...
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