没有导入日历包

时间:2018-10-01 07:54:38

标签: python matplotlib pip

尝试运行以下脚本时:

import matplotlib as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()

我遇到以下错误:

C:\Users\raja\PycharmProjects\Project_test\venv\Scripts\python.exe C:/Users/raja/.PyCharmCE2018.2/config/scratches/testing.py
Traceback (most recent call last):
  File "C:/Users/raja/.PyCharmCE2018.2/config/scratches/testing.py", line 1, in <module>
    import matplotlib as plt
  File "C:\Users\raja\PycharmProjects\Project_test\venv\lib\site-packages\matplotlib\__init__.py", line 136, in <module>
    import urllib.request
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 88, in <module>
    import http.client
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 71, in <module>
    import email.parser
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\email\utils.py", line 33, in <module>
    from email._parseaddr import quote
  File "C:\Users\raja\AppData\Local\Programs\Python\Python37\lib\email\_parseaddr.py", line 16, in <module>
    import time, calendar
  File "C:\Users\raja\.PyCharmCE2018.2\config\scratches\calendar.py", line 7, in <module>
    import tkcalendar
ModuleNotFoundError: No module named 'tkcalendar'

为什么?有人知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我已修复它。

有一个不同的python程序,我将其命名为Calendar.py :(。

我还删除了已安装的Tkcalendar的两个版本