python项目中未见带有PIP的软件包(无法导入)
在Windows 10上运行,我安装了Python 3.10.4。
我正在Virtualenv上运行Python应用程序,每当我使用PIP安装软件包时,它不会反映在代码中的导入语句中,但是“ PIP列表”命令显示。
另外,每当我使用Pycharm的Python解释器安装软件包时,它会反映在代码中。任何人都可以在这件事上提供帮助,我被困。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您正在使用系统Python环境安装软件包,或者您没有配置IDE。
尝试此尝试转到项目文件夹打开Windows终端
。\ your-env-name \ scripts \ activate \ activate
where.exe pip
在场<存在<如果存在< code> pip.exe 'env-name'evarioment中的路径我指出了两种配置指南,其中一种带有pycharm,一个带有vscode
https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html#existing-environment
https://code.visualstudio.com/docs/python/environments
It seems like that you are installing the package with the system python environment or that you didn't configure the ide.
Try this go to your project folder open the Windows terminal
.\your-env-name\Scripts\activate
where.exe pip
if is present thepip.exe
path in your 'env-name' evariomentI point to two configuration guides one with pycharm and one with vscode
https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html#existing-environment
https://code.visualstudio.com/docs/python/environments