Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Python Language Server doesn't seem to work with namespace packages #71

Closed
MikhailArkhipov opened this issue Sep 7, 2018 · 2 comments
Closed
Assignees
Labels
bug Something isn't working feature: imports
Milestone

Comments

@MikhailArkhipov
Copy link

Issue Type: Bug

I'm using the bare package made by python-cookiecutter here:
https://github.com/ionelmc/python-nameless

A fresh checkout followed by a pipenv install -e . results in a couple of problems for VSCode:

  1. It can't find tests, though they are in the root, or more accurately, it says it can't find the tests, but if I look at the output log, it's running the tests, but failing on the initial import:
============================= test session starts ==============================
platform darwin -- Python 3.6.5, pytest-3.7.3, py-1.6.0, pluggy-0.7.1
rootdir: /Users/mjf/dev/python-nameless, inifile: setup.cfg
collected 0 items / 2 errors

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_nameless.py ____________________
tests/test_nameless.py:2: in <module>
    from nameless.cli import main
E   ModuleNotFoundError: No module named 'nameless'
___________________ ERROR collecting tests/test_nameless.py ____________________
ImportError while importing test module '/Users/mjf/dev/python-nameless/tests/test_nameless.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_nameless.py:2: in <module>
    from nameless.cli import main
E   ModuleNotFoundError: No module named 'nameless'
=========================== short test summary info ============================
ERROR tests/test_nameless.py
ERROR tests/test_nameless.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 2 error in 0.12 seconds ============================
__________There was an error in identifying unit tests in tests/test_nameless.py__________
___________________ ERROR collecting tests/test_nameless.py ____________________
tests/test_nameless.py:2: in <module>
    from nameless.cli import main
E   ModuleNotFoundError: No module named 'nameless'
__________There was an error in identifying unit tests in tests/test_nameless.py__________
___________________ ERROR collecting tests/test_nameless.py ____________________
ImportError while importing test module '/Users/mjf/dev/python-nameless/tests/test_nameless.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_nameless.py:2: in <module>
    from nameless.cli import main
E   ModuleNotFoundError: No module named 'nameless'
__________There was an error in identifying unit tests in ============ short test summary info__________
=========================== short test summary info ============================
ERROR tests/test_nameless.py
ERROR tests/test_nameless.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!

  1. Opening a python file src/__main__.py shows green error lines on the from nameless.cli import main... it can't find nameless.cli with the following message in the tooltip: "[Python (analysis)] Unable to resolve 'nameless.cli'. IntelliSense may be missing for this module."

This isn't my code, but my code was made with this tool, and using this package directly from checkout should help eliminate any pilot error of my own doing :-)

Extension version: 2018.8.0
VS Code version: Code 1.27.1 (5944e81f3c46a3938a82c701f96d7a59b074cfdc, 2018-09-06T09:14:32.385Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz (8 x 2300)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.21GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron
Screen Reader no
VM 0%
@MikhailArkhipov
Copy link
Author

May be the same as #12

@MikhailArkhipov
Copy link
Author

MikhailArkhipov commented Oct 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working feature: imports
Projects
None yet
Development

No branches or pull requests

3 participants