Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install numpy and pandas in python

Shulou Source: shulou.com Published: 2022-06-01 02:27:48 09月21日 Update

This article introduces the relevant knowledge of "how to install numpy and pandas in python". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Linux first installs the dependency package

Yum-y install blas blas-devel lapack-devel lapackyum-y install seaborn scipyyum-y install freetype freetype-devel libpng libpng-develyum-y install python-pipyum-y install pytzyum-y install python-dateutil

1. Pip installation

If there is a public network, it is generally recommended to use pip installation. Pip installation can be used both under linux and windows.

Python-m pip install-upgrade pippip install-user numpy scipy matplotlib jupyter pandas sympy nose

But you will soon find that the installation of these sources is super slow, so I recommend you to use Douban source.

Pip install matplotlib-I http://pypi.douban.com/simple-- trusted-host pypi.douban.compip install numpy-I http://pypi.douban.com/simple-- trusted-host pypi.douban.compip install pandas-I http://pypi.douban.com/simple-- trusted-host pypi.douban.compip install seaborn scipy-I http://pypi.douban.com/simple-- trusted-host pypi.douban.com

2. If there is no external network on the server that cannot use pip, you need to use source code to install it. It is recommended that you download from Douban pypi for faster https://pypi.doubanio.com/simple/?allow_list_dir=1

The download address of the python numpy installation package is https://pypi.python.org/pypi/numpy/ Magi pandas. The download address is https://pypi.python.org/pypi/pandas Magi GitHub. The address is https://github.com/pandas-dev.

Tar-xzf numpy-1.11.2.tar.gzcd numpy-1.11.2python setup.py build # compiles python setup.py install for a few minutes

If prompted for a lack of setuptools, download the setuptools installation from https://pypi.python.org/pypi/setuptools.

Install pandas will prompt ImportError: Building pandas requires cython needs to install Cython or upgrade Cython first, download the link https://pypi.python.org/pypi/Cython/. Install pip under windows as follows

Pip install Cython

Yum installation or pip installation can be used under linux

Yum install-y Cython.x86_64

If you need to update to the latest version of Cython, download the source code and install it.

Cd Cython-0.25.1python setup.py buildpython setup.py install

And then according to pandas

Cd pandas-0.19.0python setup.py build # for a long time, python setup.py install "how to install numpy and pandas in python" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Address recommendation content more source code knowledge Douban tips practical successful next dilemma actual quick situation article way faster server case Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Information MariaDB vpn MySQL