Visual Studio 2022 python environment not find installed lmdb package.

john zyd 421 Reputation points
2022-03-17T14:07:18.387+00:00

Hello:
I want to write some python code to test LMDB dataset.
I have Visual Studio 2022 (Enterprise 17.1.1) on Windows 10.
I created a python applcation: LMDBPytorchFunctions.py
I write some python code, but I found VS 2022 told me that pip package lmdb is not found.
I can see there is only one python environment: Python 3.9 (64-bit)
So, I installed lmdb package (version 0.9.29).
After this, VS 2022 still can NOT see lmdb package.
Refer to the image, and let me know what I can do to fix this?
Thanks,
184186-python39envnok.png

Developer technologies .NET .NET Runtime
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2022-03-17T14:40:42.043+00:00

    I know next to nothing about Python and how it integrates with VS. But some googling shows that VS uses its own search path for Python modules instead of the one's Python uses. This is documented here.

    It sounds to me like you need to go to your project in Solution Explorer and add a search path for the location(s) of your modules. It currently looks empty to me. Note that the docs say you can add the PYTHONPATH which is what Python CLI is using to get the same behavior as the CLI.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.