I'm trying to use backports
testing the code given by Sachin Joglekar in a project on convolutional neural networks for a project to classify toxic comments .
from backports import csv
but when I try to load it with python2.7 or python3 I have errors:
With python3 I have the following:
mike@mike-thinks:~/Kaggle$ sudo pip install backports.weakref
The directory '/home/mike/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mike/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: backports.weakref in /usr/local/lib/python2.7/dist-packages
mike@mike-thinks:~/Kaggle$ sudo pip install backports
The directory '/home/mike/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mike/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting backports
Could not find a version that satisfies the requirement backports (from versions: )
No matching distribution found for backports
With python2.7:
mike@mike-thinks:~/Kaggle$ python medium.py
Traceback (most recent call last):
File "medium.py", line 1, in <module>
from backports import csv
ImportError: cannot import name csv