Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The smallest python distribtion to run Sympy, Scipy, Numpy and Matplotlib

Update: I tried @user2258766 suggestion on miniconda. It was initially very promising. But, when I have installed scipy numpy matplotlib sympy, the miniconda folder size quickly grows to 1G.

enter image description here

Does this mean that the minimal size of the installation is 1G if I want to use the 4 packages I mentioned. Why they are so large? Is it still possible to shrink the installation size further?

enter image description here

--

The Scipy website recommended Anaconda.

But it installs so many un-relevant packages for me.

Is there a smallest distribution I can use?

I only want Scipy, Sympy, Numpy, and Maplotlib, not others.

Another relevant questions is, why there are so many dependencies between these Python packages?

I was programming in Java, and now feel a little bit uncomfortable to see these Python packages (Scipy e.g.) are so tightly relatively to so many other packages. Why is that the case? A reasonable explanation could possible make more comfortable to start coding in Python.

Thanks.

I am using Windows. Thanks. I was using Java and am new to Python.

like image 664
Changwang Zhang Avatar asked Apr 30 '14 19:04

Changwang Zhang


3 Answers

I'd suggest downloading miniconda: http://conda.pydata.org/miniconda.html#miniconda. Miniconda has a small footprint -- only python and conda are installed. Conda is a universal package manager for Python available on all OSes. You can now run the following:

conda create -n dev_env scipy numpy matplotlib sympy

The above will create a contained environment (named dev_env) with only the packages listed in the command. For more information on conda: http://conda.pydata.org/

like image 103
quasiben Avatar answered Oct 24 '22 00:10

quasiben


Use these commands to reduce the install size of Python libraries, by removing unnecessary downloaded package files:

# Remove about 100-300 MB of unused tar.bz2 archive files
# https://stackoverflow.com/questions/40241133
conda clean --all

# Manually delete about 1-2GB of downloaded packages, after install. See:
# https://groups.google.com/a/continuum.io/d/msg/anaconda/CZjcQKVmIgo/Xx3tYBYzCgAJ
du -sh /path/to/Miniconda/pkgs/  # Just display the folder size
rm -rf /path/to/Miniconda/pkgs/

# Manually delete the useless Pip cache of downloaded files. See:
# https://stackoverflow.com/questions/9510474/removing-pips-cache
rm -rf ~/.cache/pip           # Linux
rm -rf ~/Library/Caches/pip/  # Mac OS X
del %LocalAppData%\pip\Cache  # Windows

Direct links for info:

  • How to reduce the number of files in the anaconda directory?
  • https://groups.google.com/a/continuum.io/d/msg/anaconda/CZjcQKVmIgo/Xx3tYBYzCgAJ
  • Removing pip's cache?
like image 5
Mr-IDE Avatar answered Oct 24 '22 00:10

Mr-IDE


Just install python and individually install each library.

This site has windows installers for all the packages you mentioned:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

like image 2
Ryan Avatar answered Oct 24 '22 02:10

Ryan