Windows:Vscode Python 3 Virtualenv在尝试安装程序包时不起作用
我正在使用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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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
underC:\Users\{UserName}\AppData\Roaming\Code\User\globalStorage
folder.