3 ms·
If you `pip install numpy` on most environments it will download an optimized wheel. Anaconda also has an optimized numpy automatically. I wouldn't use the py
by ltbarcly3 7y ago
If you `pip install numpy` on most environments it will download an optimized wheel. Anaconda also has an optimized numpy automatically.
I wouldn't use the python shipped with osx because it tends to be out of date rather quickly, and it doesn't ship with libreadline.
Usually the python shipped with Ubuntu is good if it has the version you want.
If you compile it yourself from source you are in for a bad time unless you know how to install all the dependencies. Make sure you turn on optimizations when running ./configure or it will be significantly less fast.
Once you have python installed, install pip. Try the following until one works (unless you use anaconda, then you won't use pip most of the time, and I think you can just `conda install pip` if it's not there by default):
$ sudo pip install -U pip (for python3: sudo pip3 install -U pip)
$ sudo easy_install pip (easy_install-3 or something like that for python3)
(after, if those don't work, that you need to get it from somewhere else, most likely by installing python-pip via apt or whatever the package is in brew or whatever you are using)
When you want to install something globally, do NOT do `sudo pip install ...`, this can break things in a way that is hard to repair, do `pip install --user ...`, and make sure the path that --user installs are installed in is added to your $PATH. I think it's always ~/.local/bin/
If you are working on a project, always use a virtualenv, google for more details on that.
- xapata 7y agoPip doesn't always give the most optimal build. But if you care about that, you wouldn't be asking this question :-)
- deleted 7y ago[deleted]
- ltbarcly3 7y agoPip gives you whatever the default build is, but for numpy they build optimized builds into wheels for almost every platform. https://pypi.org/project/numpy/#files https://pypi.org/project/numpy/#files For anything else, you have to get into the details of how it is built and what the options are which is going to depend on the specific package. Building numpy yourself is not beginner friendly, you have to know a ton of details about linear algebra packages.
- xapata 7y agoConda is helpful for the odd cases where one C dependency conflicts with another and you need to be careful specifying which build you want.