Windows:Vscode Python 3 Virtualenv在尝试安装程序包时不起作用

发布于 2025-01-21 06:46:30 字数 1139 浏览 2 评论 0 原文

我正在使用Python 3.10.4。我正在尝试从事一个Django项目,但是当我创建Virtualenv时,安装软件包就无法正常工作。

PS C:\Users\schad\Desktop\importExport> & c:/Users/schad/Desktop/importExport/env/Scripts/Activate.ps1
(env) PS C:\Users\schad\Desktop\importExport> pip install django-import-export
Fatal error in launcher: Unable to create process using '"C:\Users\schad\Desktop\env\Scripts\python.exe"  "C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe" install django-import-export': The system cannot find the file specified.

(env) PS C:\Users\schad\Desktop\importExport> pip install mysqlclient
Fatal error in launcher: Unable to create process using '"C:\Users\schad\Desktop\env\Scripts\python.exe"  "C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe" install mysqlclient': The system cannot find the file specified.

(env) PS C:\Users\schad\Desktop\importExport> 

I'm using Python 3.10.4. I'm trying to work on a Django project, but when I create a Virtualenv then installing the package is not working.

PS C:\Users\schad\Desktop\importExport> & c:/Users/schad/Desktop/importExport/env/Scripts/Activate.ps1
(env) PS C:\Users\schad\Desktop\importExport> pip install django-import-export
Fatal error in launcher: Unable to create process using '"C:\Users\schad\Desktop\env\Scripts\python.exe"  "C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe" install django-import-export': The system cannot find the file specified.

(env) PS C:\Users\schad\Desktop\importExport> pip install mysqlclient
Fatal error in launcher: Unable to create process using '"C:\Users\schad\Desktop\env\Scripts\python.exe"  "C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe" install mysqlclient': The system cannot find the file specified.

(env) PS C:\Users\schad\Desktop\importExport> 

project

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七色彩虹 2025-01-28 06:46:30

It's weird, the terminal trying to using

C:\Users\schad\Desktop\env\Scripts\python.exe

but it should be

C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe,

Could you try to switch the python interpreter to another one?并且请检查您是否已在settings.json文件中配置了某些内容,尽管该文件应存储在 c:\ users \ {username} \ appdata \ roaming \ roaming \ code \ code \ user folder中的存储中。

您可以尝试切换到另一个python解释器,然后切换回去,如果仍然不起作用,则可以删除 state.vs state.vscdb c:\ users \ users \ users \ {username} \ appdata \ roaming \ roaming \ roaming \代码\ user \ globalStorage 文件夹。

It's weird, the terminal trying to using

C:\Users\schad\Desktop\env\Scripts\python.exe

but it should be

C:\Users\schad\Desktop\importExport\env\Scripts\pip.exe,

Could you try to switch the python interpreter to another one? And please check whether you have configured something in your settings.json file although this should be stored in the storage under C:\Users\{UserName}\AppData\Roaming\Code\User folder.

You can try to switch to another python interpreter and then switch back, if it still does not work you can delete state.vscdb under C:\Users\{UserName}\AppData\Roaming\Code\User\globalStorage folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文