Hacker News new | ask | show | jobs
by cabalamat 4698 days ago
> For many people, installing numpy may be difficult or impossible. For example, people in corporate environments may have to go through a difficult, time-consuming process before being permitted to install third-party software.

I do not regard this as a good justification for putting something in the standard library! If you don't have root access, use vitualenv (which you might want to do anyway) and install the package somewhere under your home directory.

5 comments

Never under-estimate how much more helpful it can be to have something in a standard library. I do a lot of embedded development, and we have Python scripts all over the place on various embedded targets to perform all sorts of functions. Often it is incredibly inconvenient, expensive or even impossible to install extra packages on those machines, due to lack of permissions, lack of bandwidth, lack of time, or even a read only form of disk to name but a few reasons.

If your work involves a lot of scientific computing then yes, you're going to need numpy but if you're just updating an existing script that's doing some performance monitoring, having an accurate version of mean and standard deviation available seems like a great idea.

Python attempts to be batteries included, this is part of its philosophy and one of the reasons for its popularity. I'm glad this is being extended into a new area.

NumPy is not nearly portable enough to do what you are describing as a user on a windows machine. You cannot simply do a `pip install numpy` into a virtualenv. Instead you must either install the package system-wide, or compile it yourself, which means getting a working MinGW environment or similar.

Edit: Although, I do agree that NumPy being difficult to install is not, on its own, a good justification for the PEP.

numpy is quite portable, I am not sure what you mean by not nearly portable enough.

The reason why you can't do pip install numpy is pip's fault, there is nothing that numpy can do to make that work. Note that easy_install numpy does work on windows (without the need for a C compiler).

the problems I have had with numpy are endless. Usually I'll just prefer to write my own, because it's quicker. if you have tried to get numpy running on a cloud machine you'll know what I'm talking about. basically you will have to know how to compile from source, know some gcc, etc. the last time I tried to get it running I promised myself never to use numpy again.
I suggest you try again. I think the situation has changed. I have been using Numpy/Scipy for a few years now, with all the negative experience of having to sort out whether to use g77 or gfortran and the right gcc flags etc. The most recent version, Numpy 1.7.0, is the first one that installed for me smoothly on Windows and OS X (official packages). YMMV, but I think it is alright now.
many people have been able to use numpy on clouds. You only need gcc and the python-dev package on linux.

Frankly, building numpy is not very complicated (scipy is a bit complicated, and only if you are not on linux).

> basically you will have to know how to compile from source, know some gcc, etc.

If you're happy with the system-wide Python, try apt-get install python-numpy next time.

I'm back at work, and have had a chance to verify; it turns out that you were correct. I was confused by my bad memories of trying to install SciPy into a virtualenv.
Having the technical capability to do something is not the same as having permission to do it. The PEP refers to corporate policies. Installing third-party software in your home directory would be just as much a violation as doing it in a location that requires root.
Son, I hope you never have the displeasure of working in an enterprise environment.

First of all, as others mentioned, your personal machine runs on Windows so right off the bat there goes your instant virtualenv, pip install.

Even on the Unix app server, you're probably behind a firewall that's tight as a duck's ass so chances are you're downloading the tar ball and making the package yourself.

Third, wtf are you doing littering the app server with all these binaries? And what is Python? I'm sorry, no, rewrite this in Java, please.

If you do manage to convince your manager and the rest of your team that Python is not black magic, the first time numpy breaks or some small issue crops up or you have to migrate to a new server and reinstall numpy but now there's a new version and... GTFO of here with that black magic.

I agree with you, developing websites on your MacBook Pro there's no excuse not being able to install numpy. In the real world though, having basic necessities in stdlib does absolute wonders.

Not everybody using python is writing freestanding software for machines they control. Lots of software for example ship with a python install for scripting, automation or writing plugins for example.