I'm using a Django server on PythonAnywhere, using a virtualenv. In the server I'm using a scraping code to write a text file, the code uses urllib2 which should come bundled in python by default but there are various errors :
pip install urllib2
Could not find a version that satisfies the requirement urllib2 (from versions: )
No matching distribution found for urllib2
apt-get install python-urllib2
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Of course the root of the issue is this (from python console) :
import urllib2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'urllib2'