Title: Python unresolved import issue · Issue #5786 · microsoft/vscode-python · GitHub
Open Graph Title: Python unresolved import issue · Issue #5786 · microsoft/vscode-python
X Title: Python unresolved import issue · Issue #5786 · microsoft/vscode-python
Description: Environment data VS Code version: 1.34.0 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows 10 v. 1809 Python version (& distribution if applicable, e.g. Anaconda): 3.5.2 64-bit without Conda...
Open Graph Description: Environment data VS Code version: 1.34.0 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows 10 v. 1809 Python version (& distribution if applicable, e....
X Description: Environment data VS Code version: 1.34.0 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows 10 v. 1809 Python version (& distribution if applicable...
Opengraph URL: https://github.com/microsoft/vscode-python/issues/5786
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python unresolved import issue","articleBody":"\u003c!-- \r\nDo you have a question instead of a bug report or enhancement request? Please ask it on https://stackoverflow.com/questions/tagged/visual-studio-code+python. \r\n\r\nUnable to install a linter or formatter? 'No installers available'? \r\nWindows - https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows\r\nLinux - https://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-linux-install-pipclient/ , https://www.tecmint.com/install-pip-in-linux/\r\n\r\nPython configuration issues? Please check https://code.visualstudio.com/docs/python/python-tutorial#_prerequisites\r\n\r\nOtherwise **please** fill in the requested details below. \"XXX\" markers should not be present in the final bug report.\r\n\r\nIf you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ .\r\n-->\r\n\r\n## Environment data\r\n\r\n- VS Code version: 1.34.0\r\n- Extension version (available under the Extensions sidebar): 2019.4.12954\r\n- OS and version: Windows 10 v. 1809\r\n- Python version (& distribution if applicable, e.g. Anaconda): 3.5.2 64-bit without Conda\r\n- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): I guess I have no venv set up. \r\n- Relevant/affected Python packages and their versions: Microsoft Python Language Server v. 0.2.86\r\n\r\n## Actual behaviour\r\n\r\nI open VSCode in a root folder where all my code exists. Part of it looks like this:\r\n\r\n* workspaceRootFolder\r\n * .vscode\r\n * network\r\n * section_network_input.py\r\n * timepredictionslib\r\n * build\r\n * dist\r\n * timepredictionslib\r\n * Here in subfolders are all my classes in the module\r\n * .env\r\n\r\nIn the 'network' folder I have some script that I run straight from PowerShell whereas in 'timepredictionslib' I have my custom module where I store all reuasuable classes.\r\n\r\n All code runs smooth when run by the Python interpreter, however when I disabled Jedi and switched to Microsoft Python Language Server I get the 'unresolved import' error\r\n\r\n\r\nI already added the '.env' file with the following content: \r\nPYTHONPATH=timepredictionslib\r\n\r\nand added the file as python.envFile as was advised here: \r\nhttps://github.com/Microsoft/vscode-python/issues/3840#issuecomment-463789294\r\n\r\nAlso I added python.autoComplete.extraPaths as was proposed here: \r\nhttps://github.com/microsoft/python-language-server/issues/1099\r\n\r\nBut none of these helped. Do you guys have any idea what else I need to do for the Lanugage Server to discover my library?\r\n\r\nOne more thing. When I tried to update the first import presented in the attached screen it is then discovered by the Language Server and IntelliSense but not by Pylint and the Python interpreter: \r\n\r\n\r\n## Steps to reproduce:\r\nIf needed I will create a smaller project with similiar configuration and push it to GutHub.\r\n\r\n## Logs\r\nOutput for `Python` in the `Output` panel\r\n\r\n\r\n## settings.json for Python\r\n\r\n","author":{"url":"https://github.com/chudytom","@type":"Person","name":"chudytom"},"datePublished":"2019-05-26T12:50:21Z","url":"https://github.com/microsoft/vscode-python/issues/5786"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4266ee21-30b8-a91f-7e4d-6053de25766b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95A4:E34D0:BA27F5:FC15BE:6AFE6BFA |
| html-safe-nonce | 2e3b8edd6ee322bdc49adeeb29e3a41e037a9247a2ec3065cdce96340596a611 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUE0OkUzNEQwOkJBMjdGNTpGQzE1QkU6NkFGRTZCRkEiLCJ2aXNpdG9yX2lkIjoiMjcyOTAzODAwOTk3MzIzODc3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e0e3e0e75ffe69360c5d8481e93c90f87a0e284662fe48e5aa73ff74551b8742 |
| hovercard-subject-tag | issue:448563915 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-python/5786/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f52a49a9a3d7e84b4997bb267591f230977cb2f74b8bf234a279f5fcfea92e2e/microsoft/vscode-python/issues/5786 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f52a49a9a3d7e84b4997bb267591f230977cb2f74b8bf234a279f5fcfea92e2e/microsoft/vscode-python/issues/5786 |
| og:image:alt | Environment data VS Code version: 1.34.0 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows 10 v. 1809 Python version (& distribution if applicable, e.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chudytom |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-python git https://github.com/microsoft/vscode-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 106462765 |
| octolytics-dimension-repository_nwo | microsoft/vscode-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 49946255 |
| octolytics-dimension-repository_parent_nwo | DonJayamanne/pythonVSCode |
| octolytics-dimension-repository_network_root_id | 49946255 |
| octolytics-dimension-repository_network_root_nwo | DonJayamanne/pythonVSCode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width