Python Virtual Environment used by VS Code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Python Virtual Environment used by VS Code

Python Virtual Environment used by VS Code

The MCUXpresso Installer starting with v1.3 and the MCUXpresso extension for VS Code use a virtual environment (VE) for Python.  To manually use this VE from CLI, install new modules or upgrade modules, this VE needs to be activated.

The VE is activated by running a script, in Windows the script is a activate.bat file.  The MCUXpresso Installer log shows the path to this script.  In Windows, this script is typically installed at C:\Users\<username>\.mcuxpressotools\.venv\Scripts\activate.bat.  Running this script from a command window activates that environment.  In the screenshot below, notice the prompt includes the (.venv) VE name after the script runs. 

dereksnell_0-1717621214329.png

Now Python commands can be run within this VE.  If multiple Python versions are installed in the system, you can ensure the VE Python is used by using the full path to the VE Python executable.  For example, to install pip in this VE in Windows, run this command:

C:\Users\<username>\.mcuxpressotools\.venv\Scripts\python.exe -m ensurepip --upgrade

 

无评分
版本历史
最后更新:
‎06-05-2024 02:14 PM
更新人: