Skip to content
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

Unable to find the package installed in editable mode #6923

Closed
JerryZRF opened this issue Feb 6, 2025 · 1 comment
Closed

Unable to find the package installed in editable mode #6923

JerryZRF opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
pep 660 Issues related to PEP 660 import hooks

Comments

@JerryZRF
Copy link

JerryZRF commented Feb 6, 2025

Environment data

  • Pylance version: 2025.2.1
  • OS and version: macOS 12.7.6
  • Python version: Python 3.13.1 | packaged by conda-forge | (main, Dec 5 2024, 21:18:03) [Clang 18.1.8] on darwin

Code Snippet

import something

Repro Steps

  1. pip install -e /path/to/another/project
  2. import something in the project
  3. reportMissingImports occurred.

Logs

[{
	"owner": "python",
	"code": {
		"value": "reportMissingImports",
		"target": {
			"$mid": 1,
			"path": "/microsoft/pyright/blob/main/docs/configuration.md",
			"scheme": "https",
			"authority": "github.com",
			"fragment": "reportMissingImports"
		}
	},
	"severity": 4,
	"message": "无法解析导入“xxxxx”",  
	"source": "Pylance",
	"startLineNumber": 6,
	"startColumn": 6,
	"endLineNumber": 6,
	"endColumn": 10
}]
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Feb 6, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Feb 6, 2025

Thanks for the issue but this is by design. You can see these issues here for an explanation:
https://github.com/microsoft/pylance-release/issues?q=is%3Aissue%20state%3Aclosed%20label%3A%22pep%20660%22

And this discussion item that came out of one those issues:
#6384

These directions tell you how to install such that a static type checker can find the imports:
https://microsoft.github.io/pyright/#/import-resolution?id=editable-installs

@rchiodo rchiodo closed this as completed Feb 6, 2025
@rchiodo rchiodo added the pep 660 Issues related to PEP 660 import hooks label Feb 6, 2025
@judej judej removed the needs repro Issue has not been reproduced yet label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pep 660 Issues related to PEP 660 import hooks
Projects
None yet
Development

No branches or pull requests

4 participants