microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.71k stars 765 forks source link

Import "chinese_calendar" could not be resolved #2033

Closed illidan-liu closed 2 years ago

illidan-liu commented 2 years ago

the code

import chinese_calendar

the error message

Import "chinese_calendar" could not be resolved

environment

VScode 1.61.2 Pylance v2021.11.0 Python 3.8.8 pip 21.0.1 chinesecalendar 1.6.0

details

{
    "resource": "/d:/xxx/Code/backtester/backtest.py",
    "owner": "_generated_diagnostic_collection_name_#0",
    "code": {
        "value": "reportMissingImports",
        "target": {
            "$mid": 1,
            "external": "https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules",
            "path": "/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md",
            "scheme": "https",
            "authority": "github.com",
            "fragment": "diagnostic-severity-rules"
        }
    },
    "severity": 4,
    "message": "Import \"chinese_calendar\" could not be resolved",
    "source": "Pylance",
    "startLineNumber": 2,
    "startColumn": 8,
    "endLineNumber": 2,
    "endColumn": 24
}
illidan-liu commented 2 years ago

After restarting VSCode, there is no error message...

jakebailey commented 2 years ago

If you installed the package in a virtual environment outside of your workspace, it's likely #923.