0

I have installed pandas with apt-get package manager via code

sudo apt-get install python3-pandas

Because pip install pandas hungs long time.

I need to use pandas inside a virtual environment. How can i use a apt-get installed Python package inside virtual environment?

mcan
  • 1,914
  • 3
  • 32
  • 53
  • 1
    This is arguably a duplicate of [make virtualenv inherit specific packages from your global site packages](https://stackoverflow.com/questions/12079607/make-virtualenv-inherit-specific-packages-from-your-global-site-packages), unless one wishes to just have *all* site packages be accessible (as `virtualenv --system-site-packages` will); I'm sure we have another prospective dupe for that simpler case. – Charles Duffy Jun 16 '18 at 23:02
  • Why would you do this? Why not just download padnas from its website and then create an environment with `conda create`? – Colonder Jun 17 '18 at 00:18
  • Possible duplicate of [How I can make apt-get install to my virtualenv?](https://stackoverflow.com/questions/11441546/how-i-can-make-apt-get-install-to-my-virtualenv) – phd Jun 17 '18 at 12:01

1 Answers1

1

I have simply copied the original pandas directory to the virtual environment directory.

cp -R /usr/lib/python3/dist-packages/pandas /home/pi/.virtualenvs/insta/lib/python3.5/site-packages
mcan
  • 1,914
  • 3
  • 32
  • 53