Title: Unresolved import when opening a subdirectory of an import root as the workspace root · Issue #1060 · microsoft/python-language-server · GitHub
Open Graph Title: Unresolved import when opening a subdirectory of an import root as the workspace root · Issue #1060 · microsoft/python-language-server
X Title: Unresolved import when opening a subdirectory of an import root as the workspace root · Issue #1060 · microsoft/python-language-server
Description: Anti-Distinctlyminty commented on Mon May 06 2019 Environment data VS Code version: 1.33.1 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows_NT x64 10.0.17134 Python version (& distribution ...
Open Graph Description: Anti-Distinctlyminty commented on Mon May 06 2019 Environment data VS Code version: 1.33.1 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows_NT x64 10...
X Description: Anti-Distinctlyminty commented on Mon May 06 2019 Environment data VS Code version: 1.33.1 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows_NT x64 10...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/1060
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unresolved import when opening a subdirectory of an import root as the workspace root","articleBody":"@Anti-Distinctlyminty commented on [Mon May 06 2019](https://github.com/microsoft/vscode-python/issues/5563)\n\n## Environment data\r\n\r\n- VS Code version: 1.33.1\r\n- Extension version (available under the Extensions sidebar): 2019.4.12954\r\n- OS and version: Windows_NT x64 10.0.17134\r\n- Python version (& distribution if applicable, e.g. Anaconda): 2.7.11 64-bit\r\n\r\n## Expected behaviour\r\n\r\nWith `python.autoComplete.extraPaths` set correctly, modules should import without issue.\r\n\r\n## Actual behaviour\r\n\r\nI receive a `Unresolved import 'moduleName'` when using syntax of the form\r\n`import workspace_folder.module as alt_name`\r\n_and_ if the .code-workspace file is in the same directory.\r\ne.g.\r\n\r\n\r\n## Steps to reproduce:\r\n1. Extract the following to a suitable location:\r\n[myLib.zip](https://github.com/Microsoft/vscode-python/files/3148114/myLib.zip)\r\n2. Inside myLib, open the Import_Bug.code-workspace file\r\n3. Go to workspace settings and change the `python.autoComplete.extraPaths` to the folder containing myLib.\r\n4. open libFunctions.py and see that `import myLib.importMe as im` has an unresolved import error.\r\n\r\nI am aware that the organization of this workspace is sub-optimal, with the code-workspace file being inside the python library folder. However, with all paths being set correctly, the import should still succeed.\r\n\r\n## Logs\r\nOutput for `Python` in the `Output` panel (`View`→`Output`, change the drop-down the upper-right of the `Output` panel to `Python`)\r\n\r\nBlank.\r\n\r\nOutput from `Console` under the `Developer Tools` panel (toggle Developer Tools on under `Help`; turn on source maps to make any tracebacks be useful by running `Enable source map support for extension debugging`)\r\n\r\nBlank.\r\n\n\n","author":{"url":"https://github.com/luabud","@type":"Person","name":"luabud"},"datePublished":"2019-05-09T18:05:03Z","url":"https://github.com/microsoft/python-language-server/issues/1060"}
| 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:42bcf9e4-e9d7-f025-61ee-94e887b92513 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95B8:D707B:25C439:31B8A7:6AFE5A1C |
| html-safe-nonce | 6024fd504b6ee34be5ccfb2d697ad8016bb1e3e9dfbe168dd7af85439fcd85c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUI4OkQ3MDdCOjI1QzQzOTozMUI4QTc6NkFGRTVBMUMiLCJ2aXNpdG9yX2lkIjoiNTc5MzQ1OTQ1Mjk3MTQ3MzQzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b2feb214552c29da10d048a343c1c94bec0cbfa4396aa45524c5aeefed2e7bcf |
| hovercard-subject-tag | issue:442362412 |
| 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/python-language-server/1060/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89313e3078c80caa051696e8f2f30f6d5c9ac5e0ffe06b0c987465900a5379ec/microsoft/python-language-server/issues/1060 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89313e3078c80caa051696e8f2f30f6d5c9ac5e0ffe06b0c987465900a5379ec/microsoft/python-language-server/issues/1060 |
| og:image:alt | Anti-Distinctlyminty commented on Mon May 06 2019 Environment data VS Code version: 1.33.1 Extension version (available under the Extensions sidebar): 2019.4.12954 OS and version: Windows_NT x64 10... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luabud |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| 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