PIP (Python) : ImportError: cannot import name _remove_dead_weakref

I’m pretty sure the reason for this error is how you’re installing python and that you’ve most likely copied your installation from somewhere else .. or you’re renaming folders .. or you’ve an invalid python installation in your environmental path.

If you’re looking to copy the python folder about, don’t install it ‘for all users’ .. just install it to your folder for your ‘logged in user only’.

So your solution should be either

  1. install python again pointing to your location c:\python27 or
  2. install python using the ‘install just for this user’ .. then copy from it to your c:\python27 .. you might be interested in pipenv and virtualenv (google search for them)

Also, you can run pip using

python -m pip install <module_to_install>

This is the same as running

pip.exe install <module_to_install>

You could try using the full path for python to see if it runs pip ok. eg. c:\python27\python.exe -m pip install <module_to_install>

Leave a Comment