Forums

Lots of ImportWarning after I updated requests

Hi All,

I'm using the default version of Python, looks like 3.4, in a console. I was trying to open a url with requests. But I was getting a very strange socket error, something like unclosed socket.socket So googling about, it seemed like a solution was to update requests. And I did. And the socket error is gone. But I've somehow screwed up access to like every other library :) When I run this script I get like a zillion errors like this for different libraries.

/usr/lib/python3.4/importlib/_bootstrap.py:579: ImportWarning: Not importing directory /usr/local/lib/python3.4/dist-packa
ges/virtualenvwrapper: missing __init__

What to do?

PS, I updated requests like this:

pip3 install requests --user --upgrade

What is the script that you run that vies you a zillion errors? And can you give the full error traceback?

Huh, so it turns out I just needed to import requests before agate. ¯_(ツ)_/¯

this gives a bunch of import warnings before printing "ok":

import agate
import requests
print ("ok")

this gives no import errors before printing "ok":

import requests
import agate
print ("ok")

How weird! Glad you worked it out, anyway :-)