pyright: import "pandas" could not be resolved #6646
-
When importing a third-party Python library (which I have already downloaded), Zed prompts an error. How should I set it up. For example, in Pandas below, I reported an error while importing, but it was able to run successfully |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Pandas would use the default python distribution, i.e. whatever is in the global definition... so anything you install globally or through In order to be more project specific, try to use {
"venvPath": "/Users/<user>/.pyenv/versions",
"venv": "core"
} As long as your specified virtual env has the package installed it will work. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
If you are managing Python environment using [tool.pyright]
venvPath = "."
venv = ".venv" Here is a similar Q&A(https://github.com/zed-industries/community/discussions/1601) that you can refer to. |
Beta Was this translation helpful? Give feedback.
-
I am not a python expert and I use asdf for managing python version. This helps me pyrightconfig.json {
"pythonPath": "/home/<username>/.asdf/installs/python/3.12.4/bin/python",
"venvPath": "/home/<username>/.asdf/installs/python",
"venv": "3.12.4"
}
|
Beta Was this translation helpful? Give feedback.
If you are managing Python environment using
Rye
、Poetry
orPDM
, add the following to yourpyproject.toml
file:Here is a similar Q&A(https://github.com/zed-industries/community/discussions/1601) that you can refer to.