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.

Outline not showing functions or erroneously showing imports as functions

See original GitHub issue

Issue Report Checklist

  • [x ] Searched the issues page for similar reports
  • [ x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • [x ] Tried basic troubleshooting (if a bug/error)
    • [x ] Restarted Spyder
    • [x ] Reset preferences with spyder --reset
    • [x ] Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • [x ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

What steps reproduce the problem?

  1. outline not listing functions, doesn’t matter if they are in code cells or not image
  2. outline listing module imports as generic functions when they are moved to a new line with "" image

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)


PASTE TRACEBACK HERE

Versions

  • Spyder version: 5.1.3
  • Python version: 3.7.11
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: windows 10

Dependencies


# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.26.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso >=0.7.0;<0.9.0          :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.10.0 (OK)
pylint >=2.5.0;<2.10.0        :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.2;<1.3.0          :  1.2.2 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.1.0             :  5.1.0 (OK)
qtpy >=1.5.0                  :  1.10.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  4.0.2 (OK)
spyder_kernels >=2.1.1;<2.2.0 :  2.1.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.3 (OK)
zmq >=17                      :  22.2.1 (OK)

# Optional:
cython >=0.21                 :  None (OK)
matplotlib >=2.0.0            :  3.4.2 (OK)
numpy >=1.7                   :  1.18.5 (OK)
pandas >=1.1.1                :  1.1.2 (OK)
scipy >=0.17.0                :  1.6.3 (OK)
sympy >=0.7.3                 :  None (OK)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Brow71189commented, Sep 13, 2021

A bit off topic here but just in short: The python import system considers each package (i.e. folder) that dies not contain a “init.py” file a “namespace package”. You don’t need that for standalone projects normally. It is only useful if you want to have multiple projects to be importable from the same namespace. This is the (lenghty but detailed) description of namespace packages: https://www.python.org/dev/peps/pep-0420/

Moritz Lürig @.***> schrieb am Mo., 13. Sep. 2021, 16:28:

curious…

Your phenopype.core package is a namespace package. Is that intentional?

I guess not, because I don’t know what a namespace package is. at least, I couldn’t guess from your example…

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/16406#issuecomment-918250866, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7SKK365XTAKSZO4QLV243UBYDBJANCNFSM5D4FXIAA .

2reactions
mluerigcommented, Sep 13, 2021

I’m seeing a similar issue and I think I could at least identify part of the problem, maybe the whole problem: It seems like any module that is part of a namespace package does not have its functions and classes listed in the outline.

I can confirm that this is the issue - adding an __init__.py solved it for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Outline not showing classes, methods in *some* file ...
I find the code outline does not contain the class / methods / variables for some files. Some other files work. Let me...
Read more >
Python imports not being recognised - Stack Overflow
I have been putting a collection of functions I've written into what should be a more organised format so they could be imported...
Read more >
PEP 8 – Style Guide for Python Code
Consistency within one module or function is the most important. ... code viewers may not recognize control-L as a form feed and will...
Read more >
import() - JavaScript - MDN Web Docs - Mozilla
The import() call is a syntax that closely resembles a function call, but import itself is a keyword, not a function.
Read more >
Outline Explorer Spyder 5 Does Not Show The Modules Cells
Outline not showing functions or erroneously showing imports as functions.mluerig created this issue on 20210912 The issue is replied 15.
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