简体   繁体   English

如何在 jupyter notebook 上安装 chartify?

[英]How to install chartify on jupyter notebook?

I am unable to install and use spotify's visualization module which is called chartify.我无法安装和使用称为chartify 的spotify 可视化模块。 https://github.com/spotify/chartify https://github.com/spotify/chartify

In the installation it claims I only need to pip3 install it which I did using cmd.在安装中,它声称我只需要使用 cmd pip3 安装它。 Now I have opened my jupyter notebook, and when I try to import the module it can not find it.现在我打开了我的 jupyter notebook,当我尝试导入模块时,它找不到它。

import chartify

I expect the module to be imported but instead i get the following我希望导入模块,但我得到以下信息

--------ModuleNotFoundError         Traceback (most recent call last)
<ipython-input-32-e4ea3e2db907> in <module>()
----> 1 import chartify

ModuleNotFoundError: No module named 'chartify'

Open a notebook, and enter打开笔记本,输入

import sys
!{sys.executable} -m pip install chartify

into a code cell, execute it, and see how it goes.进入一个代码单元,执行它,看看它是如何进行的。

It might not work due to missing permissions, but that is fixable.由于缺少权限,它可能无法工作,但这是可以修复的。

we get ModuleNotFoundError: No module named 'chartify' error when the library is not installed .... so i request you to run我们收到ModuleNotFoundError: No module named 'chartify'错误,当库没有安装时......所以我请求你运行

pip install chartify pip 安装图表

or或者

conda install chartify conda 安装图表

... and then try to import it...... I guess you dont have it installed or downloaded it yet ...然后尝试导入它......我猜你还没有安装或下载它

Although the question is old, just for the sake of anyone else who may be reading this: The recommended way of using pip is虽然问题很老,但只是为了其他可能正在阅读本文的人:推荐的使用 pip 的方法是

python -m pip install <packagename>

Also if you are on Linux (which I'm guessing coz you are typing pip3 and not specified the os) it is recommended that you create a virtual environment to avoid having packages installed for your system python installation.此外,如果您使用的是 Linux(我猜是因为您正在输入 pip3 而没有指定操作系统),建议您创建一个虚拟环境,以避免为您的系统 python 安装安装软件包。

The reason you do this, on Linux specially is if you have programs which run on python will install a specific version of python for your system.你这样做的原因,特别是在 Linux 上,如果你有在 python 上运行的程序,将为你的系统安装特定版本的 python。 In cases like this where either the package on version of python changes which causes incompatibility between packages, python or the installed program will become a mess to fix.在这种情况下,python 版本上的包更改导致包之间不兼容,python 或已安装的程序将变得一团糟,需要修复。

Always make a virtual enviornment with:始终使用以下内容创建虚拟环境:

python -m venv <ENV_NAME>
cd <ENV_NAME>
.\bin\activate
python -m pip install <packagename>

When you are done working on the project just do:完成项目后,只需执行以下操作:

deactivate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM