How would I install numpy library on Coding Ground?

℡╲_俬逩灬. 提交于 2019-12-05 15:44:54

Regarding neurolab and termcolor, they both are pure python modules.

Pure Python i.e. modules are written using only python. These libraries are platform independent and easily distributable.

for numpy, its a python wrapper written over C/C++ library

so, numpy requires a build toolchain, i.e. it needs to be built on platform before using it, this makes numpy module platform dependent.

The coding platforms like "Coding Ground” have a limited build tool chain for building complex C/C++ Python modules/extensions.

one of the solution is to build the module on other machine and then push that on "Coding Ground”.

I have created a build for numpy and uploaded it on my dropbox, you can install it on tutorialspointlike this:

wget "https://www.dropbox.com/s/40l9l9kpc018ehn/numpy-1.11.0-cp27-none-linux_x86_64.whl?dl=0&raw=1" -O numpy-1.11.0-cp27-none-linux_x86_64.whl

pip install --target=. numpy-1.11.0-cp27-none-linux_x86_64.whl

and this will look like

sh-4.3$ pip install --target=. numpy-1.11.0-cp27-none-linux_x86_64.whl                                                      
Processing ./numpy-1.11.0-cp27-none-linux_x86_64.whl  
Installing collected packages: numpy  
Successfully installed numpy  
sh-4.3$   
sh-4.3$ python
Python 2.7.10 (default, Sep  8 2015, 17:20:17)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.    
>>> import numpy     
>>>  

ready to use and share the project.

more reading on how to build a python wheel

Hope this solves your problem.


Edit:

As Tin Tran had requirement for scipy module, have built it for Linux.

you can access it using following script:

wget "https://www.dropbox.com/s/awsvqm4devetljm/scipy-0.17.1-cp27-none-linux_x86_64.whl?dl=0&raw=1" -O scipy-0.17.1-cp27-none-linux_x86_64.whl

pip install --target=. scipy-0.17.1-cp27-none-linux_x86_64.whl

Note: the scipy module has a dependency on numpy, make sure you have numpy installed before hand.

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