Skip to content

Flask_script with venv debug does not working #789

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

Closed
Sabutobi opened this issue Feb 15, 2018 · 3 comments
Closed

Flask_script with venv debug does not working #789

Sabutobi opened this issue Feb 15, 2018 · 3 comments
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@Sabutobi
Copy link

Sabutobi commented Feb 15, 2018

Environment data

VS Code version: 1.20.1
Python Extension version: 2018.1 (01 Feb 2018)
Python Version: 3.6
OS and version: Ubuntu 16.04

Actual behavior

ModuleNotFoundError, No module named 'flask_script'
NOTE: if I'll try to run from terminal:
source ./venv/bin/activate
python manage.py runserver --port 50000 --host some.valid.ho.st
All dependencies are working as expected

Expected behavior

Enable debug and breakpoints. Dependencies imported as expected.

Steps to reproduce:

  • Add this object launch.json :
{
            "name": "Somename",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "${workspaceFolder}/venv/bin/python3.6",
            "program": "${workspaceFolder}/manage.py",
            "cwd": "${workspaceFolder}",
            "env": {},
            "envFile": "${workspaceFolder}/.env",
            "console": "integratedTerminal",
            "args": [
                "runserver",
                "--port",
                "50000",
                "--host",
                "somevalidHost"
            ],
            "debugOptions": [
                "RedirectOutput"
            ]
        },```
-  Add this workspace settings:
```json
{
    "python.linting.pylintArgs": [
        "--load-plugins",
        "pylint_flake8"
    ],
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.pylintEnabled": true,
    "editor.formatOnSave": true,
    "python.linting.pylintPath": "pylint",
    "python.formatting.provider": "autopep8",
    "python.linting.flake8Path": "flake8",
    "python.linting.flake8Enabled": true,
    "editor.rulers": [
        120
    ],
    "python.terminal.activateEnvironments": false,
    "python.unitTest.pyTestEnabled": false,
    "python.pythonPath": "${workspaceFolder}/venv/bin/python3.6"
}```
## Logs
Output from ```Python``` output panel  
None output from Python. From integratedTerminal:
cd /home/path/to/folder ; env "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" /home/path/to/folder/venv/bin/python3.6 /home/user/.vscode/extensions/ms-python.python-2018.1.0/pythonFiles/PythonTools/visualstudio_py_launcher.py /home/user/Documents/project_folder 42923 34806ad9-833a-4524-8cd6-18ca4aa74f14 DUMMYVALUE /home/user/path/tofolder/manage.py runserver --port 50000 --host some.valid.ho.st 
Traceback (most recent call last):
  File "/home/path/to/folder/manage.py", line 7, in <module>
    from flask_script import Command, Manager, Option, Server, Shell
ModuleNotFoundError: No module named 'flask_script'```

Output from Console window (Help->Developer Tools menu)

Developer Tools / console is empty
@DonJayamanne
Copy link

DonJayamanne commented Feb 15, 2018

Please confirm flask_script has been installed in /home/path/to/folder/venv/bin/python3.6
Sounds like it isn't installed.
Please try running the script as follows and let me know what you get:
/home/path/to/folder/venv/bin/python3.6 manage.py runserver --port 50000 --host some.valid.ho.st

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug area-debugging info-needed Issue requires more information from poster labels Feb 15, 2018
@Sabutobi
Copy link
Author

Sabutobi commented Feb 16, 2018

Hi! Thanks for advise.
/home/path/o/folder/venv/bin/python3.6 manage.py runserver --port 50000 --host some.valid.ho.st -
works fine.
So to solve this issue I have add sting "pythonPath":"/home/path/o/folder/venv/bin/python3.6" to launch.json file and that have launched as expected.
At my opinion this is bug of VS code extention. I think reason in "${workspaceFolder}" flow,because absolute path have launched application. Thank for help. If you need some additional information, I'll be glad to help. Have a nice day and mood.

@DonJayamanne
Copy link

Duplicate of #691

@DonJayamanne DonJayamanne marked this as a duplicate of #691 Feb 16, 2018
@DonJayamanne DonJayamanne added closed-duplicate and removed info-needed Issue requires more information from poster labels Feb 16, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants