No module named ‘chinesecalendar‘

在学习python的时候又遇见了这个问题。

① 我cmd里面执行 pip install chinesecalendar 命令。执行结果出现successfully说明安装成功了。

② 然后我又在 jupyter里进行 !pip install chinesecalendar 的操作。执行结果出现下面这段代码也说明安装成功了。

③ 最后我查找了资料,我通过安装的路径查找了一下包的准确名称,发现我们导进去包名称出现错误。

④ 最后在Jupyter输入的命令应该是 !pip install chinese_calendar ,则操作成功

# 農曆 Class **農曆** class is in the *org.magiclen.農曆* package. ### Initialize You can't create a **農曆** instance by using **new** operator directly. You have to use the **建立** static method provided by **農曆** class to create a **農曆** instance. You can pass the year, month and the days of the month in Gregorian calendar as parameters to **建立** method. For example, we want to create a **農曆** object instance with the date 2015-12-16 in Gregorian calendar. The code will be, 農曆.建立(2015, 12, 12); For example, we want to create a **農曆** object instance with the date 2015-12-16 in Chinese calendar and we know that date is not in a leap month. The code will be, 農曆 date = 農曆.建立(2015, 12, false, 12); ### Get the date in Gregorian calendar Use **取得西曆** method to get the date in Gregorian calendar. String gregorianDate = date.取得西曆(); ### Get the date in Chinese calendar Use **取得農曆** method to get the date in Chinese calendar. String chineseDate = date.取得農曆(); ### Compute the weight of Ba Zi(八字) Use **計算八字有幾兩重** method to compute the weight of Ba Zi. Because **農曆** object has no hour information, if you want to compute the weight of Ba Zi, you have to provide the hour information in the form of the twelve Earthly Branches. float BaZiWeight = date.計算八字有幾兩重(農曆.地支.子); # Run **Java Chinese Calendar** as a program You can also use the two commands below to run **Java Chinese Calendar**: java -jar JavaChineseCalendar.jar It will show today's date in Gregorian calendar and Chinese calendar. The result just likes 西曆:2015-12-16 農曆:2015(乙未、羊年) 冬月 初六 Yo
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值