When you want to do something by Python in Ubuntu, once you using the pip install module_name
to install the package, you would meet you have no right to use pip install.
Therefore, you should use the venv
tools to generate a virtual environment. the full command is
python3 -m venv venv_folder_name
The result as show in Figure 1.
Figure 1. The sample of how to generate virtual environment in Ubuntu on vs code
After that, the venv_folder_name will be generated in your workspace, then you should to activate this folder, the command line is present following.
source venv_folder_name/bin/activate
Then you can use pip install module_name
to install the packages.
本文共 0 个字数,平均阅读时长 ≈ 0分钟
评论 (0)