2

I updated python (from 3.5 to 3.6) and notice that all modules i installed for 3.5 are now no more available for importing in 3.6.

When i try to import PIL in 3.6 for example there is:

>>> import PIL
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import PIL
ModuleNotFoundError: No module named 'PIL'
>>> 

How can i use modules in 3.5 which i imported while in version 3.5? Do i have to change some path after updating python or install the modules again every time i update?

Mazdak
  • 105,000
  • 18
  • 159
  • 188
braasch
  • 57
  • 5
  • have u tried updating ur pip? – Tanay Agrawal May 19 '18 at 07:36
  • `pip install pillow`if you have it reinstall – Druta Ruslan May 19 '18 at 07:39
  • Related : https://stackoverflow.com/questions/23832722/python-select-one-of-multiple-installed-module-versions?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Mazdak May 19 '18 at 07:40
  • 1
    You might want to update your question with information about how exactly you installed these libraries and perhaps which platform you're on. But yes, typically, libraries go in a directory whose name includes the Python version number. – tripleee May 19 '18 at 08:03
  • thanks for answering, i reinstalled pillow and it worked. i just wanted to know if this is the usual way to handle modules after upgrades. so this means after every python update i have to manually reinstall every module? – braasch May 19 '18 at 10:01
  • Yes, it is normal to have to install modules again after changing Python versions. You're not actually updating to a new version of Python, you're installing a new version, so it doesn't know about any of your existing modules. Many of us use package managers to help ease things like this. – radarhere Jul 26 '18 at 10:52

0 Answers0