I have a problem with installing csv package in pycharm (running under python 3.5.2)
When I try to install it I get an error saying
Executed command:
pip install --user csv
Error occurred: Non-zero exit code (1)
Could not find a version that satisfies the requirement csv (from versions: ) No matching distribution found for csv
I updated the pip package to version 9.0.1 but still nothing.
When I run the following code:
import csv
f = open('fl.csv')
csv_f = csv.reader(f)
f.close()
I get this error:
csv_f = csv.reader(f) AttributeError: module 'csv' has no attribute 'reader'
I thought it was because I could not install the "csv package"
also I tried running:
import csv
print(dir(csv))
and the print result is:
['doc', 'loader', 'name', 'package', 'path', 'spec']
A lot of methods including csv.reader are missing
This is pretty much all the useful information up until comment #29
Right-click inside a delimited text file and then click Edit as Table. Also, you can click the Edit as Table icon in the editor. In the dialog that opens, specify format settings and click OK. The dialog has two predefined formats (CSV and TSV) and lets you create a custom format.
Expand the list of the available versions in the upper-right corner of the tool window. Select the required version or keep it the latest. Click the Install button next to the version list. Once PyCharm notifies you about successful installation, you should see the package in the list of the installed packages.
for python 3, you should run this command:
pip install python-csv
You can't pip install csv
because the csv module is included in the Python installation.
You can directly use :
import csv
in your program
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With