add2virtualenv (virtualenv wrapper) does not work with scipy

匆匆过客 提交于 2019-12-01 17:17:13
bernard paulus

So, to summarize, the actual problem here is that the directory including the packages to be imported must be used, instead of the specific package. That is, instead of

add2virtualenv /Library/Python/2.7/site-packages/scipy

It should be

add2virtualenv /Library/Python/2.7/site-packages

Beware: this solution has the drawback that you do not only include scipy, but any other packages in /Library/Python/2.7/site-packages.


An alternate, space-efficent solution could be symlinking scipy directory inside the virtual env's site-package. This can be done, in your virtual env, through:

cdsitepackages
ln -s /Library/Python/2.7/site-packages/scipy scipy

All credits go to @rubik (see the comments)

Check out this answer to find your site-packages path in case it is different than the one used here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!