What is the difference between pip install and sud

2019-01-25 13:16发布

I tried installing Flask and a few packages using sudo in a virtual environment, but on trying to import Flask, it'll throw up an ImportError. On installing the same packages with pip install though it works fine. So what's the difference between these methods? I tried this on Ubuntu.

Also, where does pip install these packages? Looking through Stack Overflow I could only find questions that answer how to list packages installed by pip, but not where to find them (in context to the virtual environment)

标签: python pip
1条回答
萌系小妹纸
2楼-- · 2019-01-25 14:11
pip install

Will run pip install as the current user


sudo pip install

Will run pip install with the security privileges of another user, root for example.
You normally need may to run sudo to install a package on a system.


You may want to read linux-101-introduction-to-sudo

查看更多
登录 后发表回答