0

My system is Archlinux. My project will use NumPy, and my project is in a virtual environment created by virtualenv.

As it is difficult to install NumPy by pip, I install it by Pacman:

sudo pacman -S python-scikit-learn

But how can I use it in virtualenv?

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Kingname
  • 1,302
  • 11
  • 25
  • 1
    Why is it difficult to install it via pip? It should be quite straightforward if you have the necessary compilers, libraries etc. installed. – ThiefMaster Oct 16 '16 at 15:30
  • Agree with ThiefMaster. If you already have the required dependencies on your system from the pacman install, it should just be a case of pip install. It will be easier than messing with variables to use the system numpy. Unless you are happy to use all system libraries. – wobbily_col Oct 16 '16 at 15:36

1 Answers1

1

You can create the virtualenv with the --system-site-packages switch to use system-wide packages in addition to the ones installed in the stdlib.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
  • Yes, this is a method. But if so, I have to uninstall the unnecessary lib. But in new version of virtualenv, pip uninstall can not work.(http://stackoverflow.com/questions/14571454/virtualenv-specifing-which-packages-to-use-system-wide-vs-local) – Kingname Oct 16 '16 at 15:35
  • Why do you care about unused libs? You can still install other versions inside the virtualenv if that's what you need. – ThiefMaster Oct 16 '16 at 15:36
  • OK, anyway, I will have a try. – Kingname Oct 16 '16 at 15:38