pyright сообщает как об отсутствующем импорте (не удалось устранить), так и об ошибках общего типа (неизвестный символ импорта). Все эти библиотеки существуют — я могу без ошибок запустить код на ipython. Я использую поэзию для управления своей виртуальной средой. Мой venv активен.
Информация о virtualenv:
Virtualenv
Python: 3.10.1
Implementation: CPython
Path: /Users/jayed/Library/Caches/pypoetry/virtualenvs/create-cluster-PmxHvHbg-py3.10
Valid: True
Мой файлpyrightconfig.json
{
"venvPath": "/Users/jayed/Library/Caches/pypoetry/virtualenvs",
"venv": "create-cluster-PmxHvHbg-py3.10"
}
pyright вывод
Loading configuration file at /Users/jayed/repos/create_cluster/pyrightconfig.json
Assuming Python version 3.10
Assuming Python platform Darwin
Auto-excluding **/node_modules
Auto-excluding **/__pycache__
Auto-excluding **/.*
stubPath /Users/jayed/repos/create_cluster/typings is not a valid directory.
Searching for source files
Found 1 source file
pyright 1.1.255
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:49:6 - error: Import "google.iam.v1" could not be resolved (reportMissingImports)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:50:6 - error: Import "google.iam.v1.policy_pb2" could not be resolved (reportMissingImports)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:43:26 - error: "assuredworkloads_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:44:26 - error: "billing_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:45:26 - error: "kms_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:46:26 - error: "resourcemanager_v3" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:47:26 - error: "service_usage_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:48:26 - error: "storage" is unknown import symbol (reportGeneralTypeIssues)
8 errors, 0 warnings, 0 informations
Completed in 1.912sec
Подробнее здесь: https://stackoverflow.com/questions/727 ... virtualenv
Pyright не находит импорт из библиотек в виртуальной среде. ⇐ Python
Программы на Python
-
Anonymous
1770738698
Anonymous
pyright сообщает как об отсутствующем импорте (не удалось устранить), так и об ошибках общего типа (неизвестный символ импорта). Все эти библиотеки существуют — я могу без ошибок запустить код на ipython. Я использую поэзию для управления своей виртуальной средой. Мой venv активен.
Информация о virtualenv:
Virtualenv
Python: 3.10.1
Implementation: CPython
Path: /Users/jayed/Library/Caches/pypoetry/virtualenvs/create-cluster-PmxHvHbg-py3.10
Valid: True
Мой файлpyrightconfig.json
{
"venvPath": "/Users/jayed/Library/Caches/pypoetry/virtualenvs",
"venv": "create-cluster-PmxHvHbg-py3.10"
}
pyright вывод
Loading configuration file at /Users/jayed/repos/create_cluster/pyrightconfig.json
Assuming Python version 3.10
Assuming Python platform Darwin
Auto-excluding **/node_modules
Auto-excluding **/__pycache__
Auto-excluding **/.*
stubPath /Users/jayed/repos/create_cluster/typings is not a valid directory.
Searching for source files
Found 1 source file
pyright 1.1.255
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:49:6 - error: Import "google.iam.v1" could not be resolved (reportMissingImports)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:50:6 - error: Import "google.iam.v1.policy_pb2" could not be resolved (reportMissingImports)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:43:26 - error: "assuredworkloads_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:44:26 - error: "billing_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:45:26 - error: "kms_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:46:26 - error: "resourcemanager_v3" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:47:26 - error: "service_usage_v1" is unknown import symbol (reportGeneralTypeIssues)
/Users/jayed/repos/create_cluster/create_cluster/create_cluster.py:48:26 - error: "storage" is unknown import symbol (reportGeneralTypeIssues)
8 errors, 0 warnings, 0 informations
Completed in 1.912sec
Подробнее здесь: [url]https://stackoverflow.com/questions/72747967/pyright-is-not-finding-imports-from-libraries-in-a-virtualenv[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия