0

I installed tkcalendar as normal through pip and all installed fine:

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.

Finally, I tried installing the package with conda but here I get the following error:

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.

Update: Running python from command prompt and then running import tkcalendar works fine.

I found this guide to working with virtual environments in Spyder on github, but it seems a bit over my head...

NotAName
  • 3,821
  • 2
  • 29
  • 44

1 Answers1

0

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. Then restart Spyder and all works all right.

NotAName
  • 3,821
  • 2
  • 29
  • 44