4

I tried to install neurolab, termcolor libraries on Coding Ground for python into the working folder using

pip install --target=. neurolab
pip install --target=. termcolor

and they both worked.
But when I tried:

pip install --target=. numpy

it didn't work.

I'd like to be able to run my scripts that already work on my computer locally on Coding Ground so that I can share my project with people who don't have Python installed on their computer.

UPDATE: I was able to install neurolab, termcolor in the Numpy Terminal after using quit(). But there's no way to share project from Numpy Terminal.

UPDATE: after installing scipy python wheel I tried to run my script and got below error

  File "/home/cg/root/neurolab/train/spo.py", line 73, in __call__                                                                                                       
    from scipy.optimize import fmin_bfgs                                                                                                                                 
  File "/home/cg/root/scipy/optimize/__init__.py", line 233, in <module>                                                                                                 
    from ._minimize import *                                                                                                                                             
  File "/home/cg/root/scipy/optimize/_minimize.py", line 26, in <module>                                                                                                 
    from ._trustregion_dogleg import _minimize_dogleg                                                                                                                    
  File "/home/cg/root/scipy/optimize/_trustregion_dogleg.py", line 5, in <module>                                                                                        
    import scipy.linalg                                                                                                                                                  
  File "/home/cg/root/scipy/linalg/__init__.py", line 174, in <module>                                                                                                   
    from .misc import *                                                                                                                                                  
  File "/home/cg/root/scipy/linalg/misc.py", line 5, in <module>                                                                                                         
    from .blas import get_blas_funcs                                                                                                                                     
  File "/home/cg/root/scipy/linalg/blas.py", line 155, in <module>                                                                                                       
    from scipy.linalg import _fblas                                                                                                                                      
ImportError: libtatlas.so.3: cannot open shared object file: No such file or directory
Cœur
  • 37,241
  • 25
  • 195
  • 267
Tin Tran
  • 6,194
  • 3
  • 19
  • 34
  • 1
    There's a [NumPy terminal in IPython](http://www.tutorialspoint.com/numpy_terminal_online.php), I think that's about it. But you're fighting an uphill battle if you're trying to do any serious work on Coding Ground IMHO. – miradulo Jun 04 '16 at 20:24
  • Thanks i tried that, but then i fail trying to install neurolab. What i am doing is really simple so it's not serious work. – Tin Tran Jun 04 '16 at 20:32
  • Yeah, sorry, I may very well be wrong as far as alternatives go but my advice would be to show your friends how easy it is to install Python on their computers with Anaconda or what not :) best of luck. – miradulo Jun 04 '16 at 20:38
  • If my friend was willing too install Anaconda that would be perfect that's what i use :D – Tin Tran Jun 04 '16 at 20:51
  • First of all, yes its true Coding Ground is not meant for full stack development but yes you can use it for your day-2-day learning and experiments. Regarding Numpy, we are providing an independent terminal for Numpy. If you have any special need then let me know and I will try to setup on the server. – user1405309 Jun 05 '16 at 09:59
  • Hi @user1405309 , that is all I want a python terminal, with numpy, neurolab, termcolor installed so I can upload my 3 simple scripts that uses neurolab – Tin Tran Jun 05 '16 at 15:04
  • @user1405309, I tried NumPy terminal and when i type exit or quit it just disconnects from server i can't get into sh terminal to try to install neurolab and termcolor. I want to be able to call different scripts from sh terminal and scripts that can import numpy,neurolab, and termcolor – Tin Tran Jun 05 '16 at 21:48
  • @user1405309, I successfully installed neurolab and termcolor on Numpy terminal, but there's no option to save/share project. so i can't share it with my friends – Tin Tran Jun 06 '16 at 23:43

1 Answers1

6

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.

Neeraj
  • 551
  • 2
  • 13
  • That did help alot, but now i realized i need scipy as well, is it the same thing like do I need a whl file for it? could i trouble you for that whl file for scipy? – Tin Tran Jun 08 '16 at 06:15
  • I tried reading how to build a python wheel but then i read up to the part where it says it builds a wheel based on platform that it's built on and I am from a Windows machine so i would appreciate it if you can build me a wheel for scipy – Tin Tran Jun 08 '16 at 06:18
  • @TinTran, can you point me to import statements of your project, this will help me in finding all missing dependencies in one go. The scipy module requires blas, lapack, atlas etc. libraries, Will package the missing .so files in wheel and upload it. – Neeraj Jun 08 '16 at 16:48
  • i don't really have a project they're just 3 .py scripts. and all the imports are `for create.py` import neurolab as nl `for get_history.py` import urllib2 import zipfile import os `for run.py` import neurolab as nl import numpy as np from termcolor import colored – Tin Tran Jun 08 '16 at 18:26
  • i am kind'a confused as to why it complained about scipy because i never import scipy myself... I only ever installed numpy,termcolor,neurolab locally after installing anaconda python 2.7 64bit graphical installer. – Tin Tran Jun 08 '16 at 18:30