在虚拟环境中安装Adafruit_MPR121库

时间:2018-02-01 13:15:02

标签: python raspberry-pi virtualenv sensor adafruit

我试图在我的venv文件夹中安装Adafruit_Python_MPR121库,但它总是将它安装到全局dist-packages中,我无法从我的venv访问它们。 我不能使用--site-packages,因为我需要env中的一些本地包。

有人知道解决方案吗?

1 个答案:

答案 0 :(得分:0)

I'm sure you can and should use --site-packages. It doesn't do what you seem to think it does — it doesn't make pip install all packages globally. It makes python in the virtual env access global site-packages but pip still install packages in the virtual env (after you activate it with . env/bin/activate).