[Python] pyecharts module ② (install pyecharts module on the command line | install pyecharts module on PyCharm)


pyecharts gallery website: https://gallery.pyecharts.org/#/

  • Check out the official example at this site




1. Install the pyecharts module from the command line




1. Installation process


Use Windows + R to open the cmd "Command Prompt" application;

insert image description here

implement

pip install pyecharts

Command, download the pyecharts module, the complete download process is as follows:

insert image description here

The output of the command line is as follows: (for reference only)

C:\Users\octop>pip install pyecharts
Collecting pyecharts
  Downloading pyecharts-2.0.3-py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 467 kB/s
Collecting prettytable
  Downloading prettytable-3.7.0-py3-none-any.whl (27 kB)
Collecting jinja2
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 1.1 MB/s
Collecting simplejson
  Downloading simplejson-3.19.1-cp37-cp37m-win_amd64.whl (75 kB)
     |████████████████████████████████| 75 kB 2.6 MB/s
Collecting importlib-metadata; python_version < "3.8"
  Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Requirement already satisfied: wcwidth in d:\001_develop\022_python\python37_64\lib\site-packages (from prettytable->pyecharts) (0.2.5)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl (17 kB)
Collecting zipp>=0.5
  Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting typing-extensions>=3.6.4; python_version < "3.8"
  Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Installing collected packages: zipp, typing-extensions, importlib-metadata, prettytable, MarkupSafe, jinja2, simplejson, pyecharts
Successfully installed MarkupSafe-2.1.3 importlib-metadata-6.7.0 jinja2-3.1.2 prettytable-3.7.0 pyecharts-2.0.3 simplejson-3.19.1 typing-extensions-4.7.1 zipp-3.15.0
WARNING: You are using pip version 20.1.1; however, version 23.2 is available.
You should consider upgrading via the 'd:\001_develop\022_python\python37_64\python.exe -m pip install --upgrade pip' command.

C:\Users\octop>

2. The command line verifies whether the pyecharts module is installed successfully


In the "Command Prompt", enter python, to enter the python interpreter mode,

Then execute import pyechartsthe statement, if there is no error, it means that the pyecharts module is installed successfully;

Command line output content:

C:\Users\octop>
C:\Users\octop>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyecharts
>>>
>>> quit()

C:\Users\octop>

insert image description here





Two, PyCharm install pyecharts module




1. Install through error prompt


Directly use the import keyword to import Python third-party modules, as follows:

import pyecharts

If the pyecharts module has not been installed before, the following error will be reported:

No module named 'pyecharts' 

insert image description here

At this time, directly click the Install package pyecharts button below to install the pyecharts module directly;

The installation progress will be displayed in the lower right corner,

insert image description here

After the installation is complete, the following prompt will be displayed:

Package installed successfully
Installed packages:'pyecharts'

insert image description here

At this time, the code that imports the pyecharts module import pyechartswill no longer report an error;

insert image description here


2. Install on the Settings interface


Enter PyCharm, select the "menu bar / File / Settings" option,

insert image description here

After entering the Settings dialog box, select the Python Interpreter panel, and click the plus button in the figure below;

insert image description here

In the Available Packages dialog box, enter "pyecharts" in the search box, and then the module will be filtered out below, select the searched pyecharts module, and click the "Install Package" button below to install the module;
insert image description here

Guess you like

Origin blog.csdn.net/han1202012/article/details/131817730
Recommended