Как установить библиотеку plotly в anaconda
Перейти к содержимому

Как установить библиотеку plotly в anaconda

  • автор:

Как установить библиотеку plotly в anaconda

Скачай курс
в приложении

Перейти в приложение
Открыть мобильную версию сайта

© 2013 — 2023. Stepik

Наши условия использования и конфиденциальности

Get it on Google Play

Public user contributions licensed under cc-wiki license with attribution required

Как установить библиотеку plotly в anaconda

Authentication Prerequisites:
anaconda login To install this package run one of the following:
conda install -c plotly plotly conda install -c «plotly/label/test» plotly

Description

plotly.py is an interactive, open-source, and JavaScript-based graphing library for Python. Built on top of plotly.js, plotly.py is a high-level, declarative charting library that includes over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.

By data scientists, for data scientists

Install Plotly in Anaconda

How to install Plotly in Anaconda? The https://conda.anaconda.org/plotly says to conda install -c https://conda.anaconda.org/plotly , and The https://plot.ly/python/user-guide/ says to pip install plotly . I.e., without package. So which packages I should specify in Anaconda conda? I tried without one and get errors:

C:\>conda install -c https://conda.anaconda.org/plotly Error: too few arguments, must supply command line package specs or --file 

asked Dec 3, 2015 at 17:11
20.8k 37 37 gold badges 130 130 silver badges 218 218 bronze badges

If you are using a conda environment, it is not recommended to use pip to install packages that are available through conda, because conda manages package dependencies in a way that pip does not. It can also FUBAR your environment. Review Understanding Conda and Pip

Sep 6, 2021 at 13:04
Sep 6, 2021 at 13:14

7 Answers 7

If you don’t care which version of Plotly you install, just use pip .

pip install plotly is an easy way to install the latest stable package for Plotly from PyPi.

pip is a useful package and dependency management tool, which makes these things easy, but it should be noted that Anaconda’s conda tool will do the same thing.

pip will install to your Anaconda install location by default.

Check out this description of package and environment management between pip and conda .

Edit: The link will show that conda can handle everything pip can and more, but if you’re not trying to specify the version of the package you need to install, pip can be much more concise.

answered Dec 3, 2015 at 18:54
4,055 6 6 gold badges 29 29 silver badges 37 37 bronze badges

Why the bizarre focus on installing specific versions of packages? Both pip and conda give you the option to install a specific version. but if you’re not trying to specify the version of the package you need to install, pip can be much more concise. How come?

Feb 20, 2020 at 1:59

Clearing things up

  • Conda is used to install packages ( plotly is a package, numpy is a package, cufflinks is a package etc.)
  • The list of available packages is found in some index, which in Conda parlance is called a channel. The default, «official» channel is maintained by Anaconda (Conda’s developer), but anyone can open his own channel, and use it to distribute custom packages.

So, in the command you’ve shown: conda install -c https://conda.anaconda.org/plotly

  • The -c switch tells Conda to use a custom channel which happens to be called https://conda.anaconda.org/plotly 1
  • is the package to download from that channel.
  • Specifying a channel is optional, and if you don’t — then Conda will look in its default channels. But you must specify a package so that Conda knows what to install.

1 This is in fact a channel that belongs to a user called plotly, which is hosted on Anaconda Cloud, a free service offered by Anaconda to host custom channels.

Back to your question

This channel seems to be unmaintained (the plotly package hosted there is very old). Given that, and the fact that the official plotly documentation says to use pip , that is what I would use.

Update: plotly updated their conda build, and added conda as an installation option in their GitHub repo (albeit not in their documentation website). So you can now safely use:

conda install -c https://conda.anaconda.org/plotly plotly 

or even simpler (since Anaconda Cloud channels are searched automatically):

conda install -c plotly plotly 

When using Anaconda Python, conda is the preferred way to install packages, but in any case both conda and pip should be run under Anaconda Prompt on Windows ( Start —> Anaconda —> Anaconda Prompt ). Installing packages from the standard command prompt when you have Anaconda is discouraged and can mess up your Anaconda installation.

Как исправить: нет модуля с именем plotly

Одна распространенная ошибка, с которой вы можете столкнуться при использовании Python:

ModuleNotFoundError: No module named 'plotly' 

Эта ошибка возникает, когда Python не обнаруживает библиотеку Plotly в вашей текущей среде.

В этом руководстве представлены точные шаги, которые вы можете использовать для устранения этой ошибки.

Шаг 1: pip установить сюжетно

Поскольку Plotly не устанавливается автоматически вместе с Python, вам нужно будет установить его самостоятельно.

Самый простой способ сделать это — использовать pip , менеджер пакетов для Python.

Вы можете запустить следующую команду pip для установки сюжета:

pip install plotly 

Для python 3 вы можете использовать:

pip3 install numpy 

Затем вы можете запустить следующий код, чтобы убедиться, что Plotly был успешно установлен:

pip list | grep plotly plotly 5.3.1 

Если plotly отображается с номером версии, это означает, что он был успешно установлен.

В большинстве случаев это исправит ошибку.

Шаг 2: Установите пип

Если вы все еще получаете сообщение об ошибке, вам может потребоваться установить pip. Используйте эти шаги , чтобы сделать это.

Вы также можете использовать эти шаги для обновления pip до последней версии, чтобы убедиться, что он работает.

Затем вы можете запустить ту же команду pip, что и раньше, чтобы установить Plotly:

pip install plotly 

На этом этапе ошибка должна быть устранена.

Шаг 3: проверьте версию сюжета

После успешной установки Plotly вы можете использовать следующую команду для отображения версии Plotly в вашей среде:

pip show plotly Name: plotly Version: 5.3.1 Summary: An open-source, interactive data visualization library for Python Home-page: https://plotly.com/python/ Author: Chris P Author-email: chris@plot.ly License: MIT Location: /srv/conda/envs/notebook/lib/python3.7/site-packages Requires: six, tenacity Required-by: Note: you may need to restart the kernel to use updated packages. 

Дополнительные ресурсы

В следующих руководствах объясняется, как исправить другие распространенные проблемы в Python:

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

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