Как установить scipy python windows
Перейти к содержимому

Как установить scipy python windows

  • автор:

Installation

Methods differ in ease of use, coverage, maintenance of old versions, system-wide versus local environment use, and control. With pip or Anaconda’s conda, you can control the package versions for a specific project to prevent conflicts. Conda also controls non-Python packages, like MKL or HDF5. System package managers, like apt-get , install across the entire computer, often have older versions, and don’t have as many available versions. Source compilation is much more difficult but is necessary for debugging and development. If you don’t know which installation method you need or prefer, we recommend the Scientific Python Distribution Anaconda.

Scientific Python Distributions (recommended)#

Python distributions provide the language itself, along with the most commonly used packages and tools. These downloadable files require little configuration, work on almost all setups, and provide all the commonly used scientific Python tools.

Anaconda works on Windows, Mac, and Linux, provides over 1,500 Python packages, and is used by over 15 million people. Anaconda is best suited to beginning users; it provides a large collection of libraries all in one.

For more advanced users who will need to install or upgrade regularly, Mambaforge is a more suitable way to install the conda (and mamba , a faster conda alternative) package manager.

Other options include:

  • WinPython: Another free distribution including scientific packages and the Spyder IDE; Windows only, but more actively maintained and supports the latest Python 3 versions.
  • Pyzo: A free distribution based on Anaconda and the IEP interactive development environment; Supports Linux, Windows, and Mac.

Installing with Pip#

You can install SciPy from PyPI with pip :

python -m pip install scipy 

Installing via Conda#

You can install SciPy from the defaults or conda-forge channels with conda :

conda install scipy 

Install system-wide via a package manager#

System package managers can install the most common Python packages. They install packages for the entire computer, often use older versions, and don’t have as many available versions.

Ubuntu and Debian#

sudo apt-get install python3-scipy 

Fedora#

sudo dnf install python3-scipy 

macOS#

macOS doesn’t have a preinstalled package manager, but you can install Homebrew and use it to install SciPy (and Python itself):

brew install scipy 

Source packages#

A word of warning: building SciPy from source can be a nontrivial exercise. We recommend using binaries instead if those are available for your platform. For details on how to build from source, see this guide in the SciPy docs.

Как установить библиотеку SciPy на Windows

Обновление: собранные wheels для Windows доступны для scipy-1.0+ на PyPI, то есть стандартную команду для установки можно использовать:

T:\> pip install scipy 

старая версия ответа:

  1. Заходим на https://scipy.org
  2. Нажимаем кнопку Install
  3. Читаем инструкцию для Windows.

Инструкция рекомендует, особенно на Windows, установить не один пакет, а сразу целый набор пакетов (Scientific Python distribution) такой как Anaconda.

Если вы хотите индивидуально numpy, scipy пакеты ставить, то инструкция рекомендует бинарные установщики с Christoph Gohlke сайта, которые доступны в виде бинарных wheel файлов, которые можно напрямую с помощью pip (c версией 8+) поставить:

T:\> pip install numpy‑1.12.0b1+mkl‑cp36‑cp36m‑win_amd64.whl T:\> pip install scipy‑0.18.1‑cp36‑cp36m‑win_amd64.whl 

Если у вас 64-битная Windows используйте wheel, которые в имени содержат amd64. Если у вас Python 3.6 стоит, то используйте wheel, который cp36m в названии имеет. Перед установкой scipy, необходимо поставить numpy.

Не смешивайте установку бинарных wheel файлов (таких как на Christoph Gohlke сайте) и установку через conda.

Там есть файлы с cp27, cp34, cp35, cp36. Интересно, что это обозначает?

Соглашения для имён wheel описаны в PEP-427.

Сами метки описаны в PEP-425.

Метки существуют, чтобы указать системы, где соответствующие бинарные пакеты должны работать.

cp36m—это ABI метка, которая указывает на CPython реализацию ( sys.implementation.name ), версию 3.6 ( sys.version[:3] ) как я выше упомянул, и m буква ( sys.abiflags ) в метке указывает на —with-pymalloc опцию см. PEP-3149.

И какие нужно выбирать для 32 битной Windows?

Метка платформы определяется distutils.util.get_platform() значением согласно PEP-425.

На Windows возможны три (значения из help(distutils.util.get_platform) ):

  • win-amd64 (64bit Windows на AMD64 (aka x86_64, Intel64, EM64T)
  • win-ia64 (64bit Windows на Itanium)
  • win32 (все другие)

то есть для 32 битной Windows следует win32 метку выбрать.

Installation¶

Methods differ in ease of use, coverage, maintenance of old versions, system-wide versus local environment use, and control. With pip or Anaconda’s conda, you can control the package versions for a specific project to prevent conflicts. Conda also controls non-Python packages, like MKL or HDF5. System package managers, like apt-get , install across the entire computer, often have older versions, and don’t have as many available versions. Source compilation is much more difficult but is necessary for debugging and development. If you don’t know which installation method you need or prefer, we recommend the Scientific Python Distribution Anaconda .

Scientific Python Distributions (recommended)¶

Python distributions provide the language itself, along with the most commonly used packages and tools. These downloadable files require little configuration, work on almost all setups, and provide all the commonly used scientific python tools.

Anaconda works on Windows, Mac, and Linux, provides over 1,500 Python/R packages, and is used by over 15 million people. Anaconda is best suited to beginning users; it provides a large collection of libraries all in one.

For more advanced users who will need to install or upgrade regularly, Miniconda is a more suitable way to install the conda package manager.

Other options include:

  • WinPython: Another free distribution including scientific packages and the Spyder IDE; Windows only, but more actively maintained and supports the latest Python 3 versions.
  • Pyzo: A free distribution based on Anaconda and the IEP interactive development environment; Supports Linux, Windows, and Mac.

Installing via pip¶

Python comes with an inbuilt package management system, pip. Pip can install, update, or delete any official package.

You can install packages via the command line by entering:

python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose 

We recommend using an user install, sending the —user flag to pip. pip installs packages for the local user and does not write to the system directories. Preferably, do not use sudo pip , as this combination can cause problems.

Pip accesses the Python Package Index, PyPI , which stores almost 200,000 projects and all previous releases of said projects. Because the repository keeps previous versions, you can pin to a version and not worry about updates causing conflicts. Pip can also install packages in local virtualenv, or virtual environment.

Install system-wide via a package manager¶

System package managers can install the most common Python packages. They install packages for the entire computer, often use older versions, and don’t have as many available versions.

Ubuntu and Debian¶

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose 

Fedora 22 and later¶

sudo dnf install numpy scipy python-matplotlib ipython python-pandas sympy python-nose atlas-devel 

Mac¶

Mac doesn’t have a preinstalled package manager, but there are a couple of popular package managers you can install.

For Python 3.5 with Macports , execute this command in a terminal:

sudo port install py35-numpy py35-scipy py35-matplotlib py35-ipython +notebook py35-pandas py35-sympy py35-nose 

Homebrew has an incomplete coverage of the SciPy ecosystem, but does install these packages:

brew install numpy scipy ipython jupyter 

Source packages¶

You can build any of the packages from source. Those involved in development may take this route to get developmental versions or alter source code. Refer to individual projects for more details.

Binaries¶

Binary files can directly install the packages. These can either come from the direct source, like GitHub or PyPI , or third-party repositories. Linux operating systems, like Ubuntu , have package repositories where you can search for and download individual binaries. For Windows, Christoph Gohlke provides pre-built Windows installers for many packages.

Как установить scipy python windows

Регистрация: 26.10.2022

Сообщений: 5

Ошибка установки scipy

Не могу установить scipy в Python 10.5 Windows32.
pip install scipy пытается установить версию 1.9.3 и выдает ошибку.
Помогите, пожалуйста.

Пользователь

Регистрация: 19.12.2019

Сообщений: 69

Какую ошибку выдает?

Регистрация: 26.10.2022

Сообщений: 5

Сама ошибка мне непонятна. Вот скрины:

Изображения

Установка scipy.jpg (102.6 Кб, 5 просмотров)
Установка scipy (продолжение).jpg (108.0 Кб, 4 просмотров)

Регистрация: 15.02.2010

Сообщений: 15,673

А что неопнятно? Вам же явно написали — нет компиляторов фортрана. Вы же доку прочитали? А там:

SciPy requires a Fortran compiler to be built, and heavily depends on wrapped Fortran code.

Регистрация: 26.10.2022

Сообщений: 5

Установка scipy

Тогда почему он без проблем устанавливается на python 3.7?

Регистрация: 15.02.2010

Сообщений: 15,673

Потому что для 3.7 был готовый wheel, а для вашего нового не нашлось.

Участник клуба

Регистрация: 17.04.2022

Сообщений: 1,833

Скачал кучу палок, а колеса не собираются.

Регистрация: 26.10.2022

Сообщений: 5

Установка scipy

Есть wheel и для 3.10.5 https://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy (SciPy-1.8.1-cp310-cp310-win32.whl). И даже для 3.11.
Однако:
Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 15:58:59) [MSC v.1929 32 bit (Intel)] on win32
Type «help», «copyright», «credits» or «license()» for more information.
import scipy.cluster
Traceback (most recent call last):
File «», line 1, in
import scipy.cluster
File «D:\Python\lib\site-packages\scipy\cluster\__init__.py» , line 25, in
from . import vq, hierarchy
File «D:\Python\lib\site-packages\scipy\cluster\vq.py», line 72, in
from scipy.spatial.distance import cdist
File «D:\Python\lib\site-packages\scipy\spatial\__init__.py» , line 104, in
from ._qhull import *
ImportError: DLL load failed while importing _qhull: Не найден указанный модуль.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *