How to generate Python virtual environment in Ubuntu

Shuanglin Li
2024-03-22 / 0 评论 / 709 阅读 / 未收录,提交收录
温馨提示:
本文最后更新于2024年03月22日,已超过426天没有更新,若内容或图片失效,请留言反馈。

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.

e7c9dde8-1b47-4ec3-91e5-f2fd0dc8bdfe.png
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时0分1秒。
0

打赏

海报

正在生成.....

评论 (0)

OωO
  • ::(呵呵)
  • ::(哈哈)
  • ::(吐舌)
  • ::(太开心)
  • ::(笑眼)
  • ::(花心)
  • ::(小乖)
  • ::(乖)
  • ::(捂嘴笑)
  • ::(滑稽)
  • ::(你懂的)
  • ::(不高兴)
  • ::(怒)
  • ::(汗)
  • ::(黑线)
  • ::(泪)
  • ::(真棒)
  • ::(喷)
  • ::(惊哭)
  • ::(阴险)
  • ::(鄙视)
  • ::(酷)
  • ::(啊)
  • ::(狂汗)
  • ::(what)
  • ::(疑问)
  • ::(酸爽)
  • ::(呀咩爹)
  • ::(委屈)
  • ::(惊讶)
  • ::(睡觉)
  • ::(笑尿)
  • ::(挖鼻)
  • ::(吐)
  • ::(犀利)
  • ::(小红脸)
  • ::(懒得理)
  • ::(勉强)
  • ::(爱心)
  • ::(心碎)
  • ::(玫瑰)
  • ::(礼物)
  • ::(彩虹)
  • ::(太阳)
  • ::(星星月亮)
  • ::(钱币)
  • ::(茶杯)
  • ::(蛋糕)
  • ::(大拇指)
  • ::(胜利)
  • ::(haha)
  • ::(OK)
  • ::(沙发)
  • ::(手纸)
  • ::(香蕉)
  • ::(便便)
  • ::(药丸)
  • ::(红领巾)
  • ::(蜡烛)
  • ::(音乐)
  • ::(灯泡)
  • ::(开心)
  • ::(钱)
  • ::(咦)
  • ::(呼)
  • ::(冷)
  • ::(生气)
  • ::(弱)
  • ::(狗头)
泡泡
阿鲁
颜文字
取消