我试图在我的venv文件夹中安装Adafruit_Python_MPR121库,但它总是将它安装到全局dist-packages中,我无法从我的venv访问它们。 我不能使用--site-packages,因为我需要env中的一些本地包。
有人知道解决方案吗?
答案 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
).