Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python imports suddenly not working

Tags:

python

I had everything installed good on my laptop. Everything was working. Today when i wanted to work with my projects again just everything suddenly gives an error on imports. It's not just one package, but multiple. The only thing I could think of is Windows Update, but actually I doubt this would be the cause of the problem.

I have everything installed in 32-bit since some packages were only 32-bit. I already reinstalled everything and restarted several times. I'm not very experienced with Python, so thats why I'm wondering if anybody with more knowledge could help me with this.

The packages installed are: CherryPy, Cython, Oursql, PIL, pywin32, setuptools

Thanks in advance!!

like image 833
ProCx Avatar asked Oct 28 '25 03:10

ProCx


1 Answers

I just ran into a similar problem. Everything was working fine for a week, but today suddenly an import failed.

I found that in the directory of the module I was trying to import, there was a corrupt .pyc file. I deleted that file, then everything worked again.

like image 149
Maigo Avatar answered Oct 30 '25 13:10

Maigo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!