简体   繁体   English

Tkcalendar 安装正确但仍然出现“找不到模块”错误

[英]Tkcalendar installed correctly but still gives 'module not found' error

I installed tkcalendar as normal through pip and all installed fine:我通过 pip 像往常一样安装了 tkcalendar 并且安装得很好:

C:\Users\Pavel>python -m pip install tkcalendar
Collecting tkcalendar
  Downloading https://files.pythonhosted.org/packages/44/18/2d6a50fd9703a4cf96a24d12aee5a21b33e75d0b3e6b25fa4dcd7d06efc1/tkcalendar-1.5.1-py3-none-any.whl
Collecting babel (from tkcalendar)
  Downloading https://files.pythonhosted.org/packages/2c/60/f2af68eb046c5de5b1fe6dd4743bf42c074f7141fe7b2737d3061533b093/Babel-2.7.0-py2.py3-none-any.whl (8.4MB)
     |████████████████████████████████| 8.4MB 6.4MB/s
Requirement already satisfied: pytz>=2015.7 in c:\users\pavel\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from babel->tkcalendar) (2019.3)
Installing collected packages: babel, tkcalendar
Successfully installed babel-2.7.0 tkcalendar-1.5.1

Yet when I try to run my script I get an error that module not found:然而,当我尝试运行我的脚本时,我收到一个错误,该模块未找到:

 File "C:/Python_working/exercies/tkinter.py", line 7, in <module>
    from tkcalendar import Calendar, DateEntry

ModuleNotFoundError: No module named 'tkcalendar'

I tried restarting Spyder, tried re-installing with pip but I only get a message that package already installed.我尝试重新启动 Spyder,尝试使用pip重新安装,但我只收到一条消息,该包已安装。

Finally, I tried installing the package with conda but here I get the following error:最后,我尝试使用conda安装软件包,但在这里出现以下错误:

PackagesNotFoundError: The following packages are not available from current channels:

  - tkcalendar

Not sure what else to do to solve this issue.不知道还有什么办法可以解决这个问题。

Using Python 3.7 and Spyder 3.3.6.使用 Python 3.7 和 Spyder 3.3.6。

Update: Running python from command prompt and then running import tkcalendar works fine.更新:从命令提示符运行 python 然后运行import tkcalendar工作正常。

I found this guide to working with virtual environments in Spyder on github, but it seems a bit over my head...我在 github 上找到了有关在 Spyder 中使用虚拟环境的指南,但这似乎有点超出我的理解......

Okay-dokay... found the answer in this post .好吧……在这篇文章中找到了答案。

Basically, the idea is that for packages that are not a part of normal Spyder/Anaconda installation you need to go to Tools -> PYTHONPATH and add a new folder for each and every module.基本上,这个想法是,对于不属于正常 Spyder/Anaconda 安装的包,您需要转到 Tools -> PYTHONPATH 并为每个模块添加一个新文件夹。 Then restart Spyder and all works all right.然后重新启动 Spyder,一切正常。

暂无
暂无

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

相关问题 已安装pydispatch模块,但仍无法找到 - pydispatch module installed but still couldn't be found 已成功安装软件包(Bcrypt),但仍给出错误 - Successfully installed package (Bcrypt) but still gives error 我已经在 spyder 上安装了“apiclient”,但是当我在 Python 中运行该程序时,为什么会出现错误“找不到模块错误” - I have installed "apiclient" to the spyder but why it gives the error "Module Not Found Error" when i run the program in Python 为什么使用 pip 安装 package 后仍然出现“找不到模块”错误? - Why do I still get the “module not found” error even after having installed the package using pip install? 在python中安装模块,仍然出现错误 - installed module in python,still i got error 似乎安装了 pyodb,但出现错误,提示未找到模块 python 3.7.5。 Jupyter 实验室 - seems like pyodb is installed but gives error saying module is not found python 3.7.5. Jupyter lab 路径存在于sys.path中,但仍然在Python中提供模块未找到错误 - Path exists in sys.path but still gives module not found error in Python 安装的模块上出现“找不到Python模块”错误 - “Python module not found” error on installed module ModuleNotFoundError:没有名为“tkcalendar”的模块 - ModuleNotFoundError: No module named 'tkcalendar' 在 Pycharm 中找不到模块错误,但它作为 Anaconda 包安装 - Module not found error in Pycharm , but it is installed as Anaconda package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM