0

I am using Windows and was running Python 3.5.4 from the Anaconda distribution. I was trying to install PyQt5 on my computer and I believe I ended up disrupting Python startup.

Now when I attempt to open python or ipython or pip, I get the following error:

Error processing line 1 of C:\Users\George\Anaconda3\lib\site-packages\google_auth-1.1.1-py2.7-nspkg.pth:

Failed to import the site module
Traceback (most recent call last):
  File "C:\Users\George\Anaconda3\lib\site.py", line 167, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "C:\Users\George\Anaconda3\lib\types.py", line 166, in <module>
    import functools as _functools
  File "C:\Users\George\Anaconda3\lib\functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "C:\Users\George\Anaconda3\lib\weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\George\Anaconda3\lib\site.py", line 570, in <module>
    main()
  File "C:\Users\George\Anaconda3\lib\site.py", line 550, in main
    known_paths = addsitepackages(known_paths)
  File "C:\Users\George\Anaconda3\lib\site.py", line 327, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "C:\Users\George\Anaconda3\lib\site.py", line 206, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "C:\Users\George\Anaconda3\lib\site.py", line 177, in addpackage
    import traceback
  File "C:\Users\George\Anaconda3\lib\traceback.py", line 5, in <module>
    import linecache
  File "C:\Users\George\Anaconda3\lib\linecache.py", line 8, in <module>
    import functools
  File "C:\Users\George\Anaconda3\lib\functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "C:\Users\George\Anaconda3\lib\weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'

I would prefer not to reinstall Anaconda as I had some files saved and other packages installed, yet don't quite know what to do.

ZF007
  • 3,708
  • 8
  • 29
  • 48
Jonesn11
  • 99
  • 2
  • 11
  • Tip: never ever save project files or scripts within the anaconda file folder(s) unless you've got a backup for it elsewhere! Go for... D:\Scripts or D:\Tools\Projects.. or whatever... or even better..anything that is not a extended partition of c-drive. One bad TOC.. and most is gone with SSD's. – ZF007 Jan 08 '18 at 22:42
  • Furthermore... google_auth.... hmmm.. what on earth are you doing... install it from the source [here](https://www.anaconda.com/download/).... Google doesn't have to do anything with Anaconda2 or 3 and not even remoteply with PyQt4 or 5. – ZF007 Jan 08 '18 at 22:45
  • Yeah I had to reinstall anaconda, which resolved the issue. Since my scripts were saved in a different file, I still have them and can just reinstall other packages. Thanks, won’t make this mistake again. – Jonesn11 Jan 08 '18 at 22:47
  • You possible could have removed manually the site-package `google_auth-1.1.1` and the related "egg" folder as well. And perhaps the related py-file in the site-package root folder. Did you try that as well? – ZF007 Jan 08 '18 at 22:56
  • I tried removing the site-package then restarting, and it didn’t work but did not remove the egg or py file, but also good to know. Thanks – Jonesn11 Jan 08 '18 at 22:58
  • if removal by conda via cmd-line refuses to remove it... and if you got `pip` is installed you can ask `pip` to the rescue for removal as well. Sometimes other hero's can make things work again ;-) – ZF007 Jan 08 '18 at 23:01
  • Using pip uninstall? – Jonesn11 Jan 08 '18 at 23:06
  • yup... pip uninstall packagename. It won't work in all cases but the "why" is just me being lazy not to figure out the "why" in some cases won't cut it. (just tried to move conversation to chat but you need 20+ rep for each party member. Lol. Anyway glad it solved it self by reinstalling and you learned sidewase a few tricks for next time you encounter this type of event Good to report though. someelse may know what else to do... Enjoy SO ;-) – ZF007 Jan 08 '18 at 23:11

0 Answers0