Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code Debug Error #57

Open
StefanGreve opened this issue Oct 12, 2023 · 1 comment
Open

VS Code Debug Error #57

StefanGreve opened this issue Oct 12, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed minor Issues rated with a low priority

Comments

@StefanGreve
Copy link
Member

StefanGreve commented Oct 12, 2023

Describe the bug
It is currently not possible to debug the module in VS Code using the launch.json settings from the documentation. The error message currently reads:

Exception has occurred: ImportError
attempted relative import with no known parent package
  File "C:\Users\stefan.greve\Desktop\repos\private\anonpy\src\anonpy\__main__.py", line 15, in <module>
    from .anonpy import AnonPy, Endpoint
ImportError: attempted relative import with no known parent package

To Reproduce

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "AnonPy CLI",
            "type": "python",
            "request": "launch",
            "module": "anonpy",
            "justMyCode": true,
            "args": [
                "preview",
                "--resource",
                "Aozkv26f"
            ]
        },
        {
            "name": "AnonPy Script",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "justMyCode": true,
            "console": "integratedTerminal"
        }
    ]
}

Expected behavior
Start and execute the VS Code debugger.

Screenshots
Additional Information

  • Module Version: 1.0.0-rc.2
  • Python Version: 3.12
  • Operating System: Windows 10

Additional context
Links relevant to the problem:

This problem is also reproducible on the master branch and 1.0.0-rc.1.

The same error message appears when running this command:

python -X importtime .\src\anonpy\__main__.py
Traceback (most recent call last):
  File "C:\Users\stefan.greve\Desktop\repos\private\anonpy\src\anonpy\__main__.py", line 14, in <module>
    from .anonpy import AnonPy, Endpoint
ImportError: attempted relative import with no known parent package
@StefanGreve StefanGreve added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers minor Issues rated with a low priority labels Oct 12, 2023
@StefanGreve
Copy link
Member Author

Note: this is a regression, possibly introduced by #54?

  • figure out when this error was introduced for the first time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed minor Issues rated with a low priority
Projects
Status: Todo
Development

No branches or pull requests

1 participant