NeonBlueHair
NeonBlueHair

Reputation: 1159

Installed Python package is causing conflict for VirtualEnv but can't find and remove it

I was attempting to install some google modules (cloud and oauth2), was apparently successful in some and not others. Then the Virtualenv I installed them to stop working. When I try to run an iPython notebook the kernel keeps dying. Based on some research, it seems to be due to a conflict from what I installed, but now I can't even find the thing to remove it. Even a pip freeze or pip list command won't work, showing the same error, posted below. Anybody know where I can go to find the google module mentioned in the error so I can get rid of it and go back to how it was before?

  Traceback (most recent call last):
  File "/Users/my_user_name/.virtualenvs/my_virtualenv/lib/python2.7/site.py", line 703, in <module>
    main()
  File "/Users/my_user_name/.virtualenvs/my_virtualenv/lib/python2.7/site.py", line 683, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "/Users/my_user_name/.virtualenvs/my_virtualenv/lib/python2.7/site.py", line 282, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/Users/my_user_name/.virtualenvs/my_virtualenv/lib/python2.7/site.py", line 204, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/Users/my_user_name/.virtualenvs/my_virtualenv/lib/python2.7/site.py", line 173, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
KeyError: 'google'

This is the same error that repeatedly shows when I try to run an iPython notebook with that kernel. The problems don't exist outside of this virtualenv.

Upvotes: 0

Views: 588

Answers (1)

phd
phd

Reputation: 94397

site.addpackage() reads and interprets *.pth files from site-packages directory. Check all files for something unusual.

Or simply destroy and recreate the failing virtual envs.

Upvotes: 1

Related Questions