Reputation: 13
I 'm a Chinese student, When I use pip to update and install, problems like this always occur. My computer is Windows 64.
E:\>python -mpip install —upgrade Pip
Collecting pip
Downloading https://files.pythonhosted.org Packages 'c2 d7 D0f34c60d83a6c5631cf71dfe64cc1054598c843e0211400e55675c. pip-18.1 -PYS.py3 -none -any.whl (1.3MB)
-----------------100% 1.3MB 155kB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Rolling back uninstall of pip
File"C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\configparser.py", line 1079, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'setup.cfg', line: 1
'<?xml version="1.0" encoding="utf-8"?>\n'
I googled it and it seems to be a BOM error, but how could I deal with it?
Upvotes: 1
Views: 695
Reputation: 984
Update:
As Adam Smith commented correctly, this doesn't solve the real issue, which looks like a byte-sequence error in the setup.conf
file.
As kintoki stated, you can try the very popular Miniconda as your environment, which solves a lot of issues with Python on Windows, but a small caveat is that new version for packages might take some time until you can install them. It is very popular in the data-science community. I am looking for a more proper answer and will update it here.
Original:
Pip and Windows don't always work well together. The best way to get around that is to download the packages you want to as pre-compiled binary whl files, directly from University of Califonia, Irvine python package index for Windows.
Then you can install them directly with pip! And don't forget that pip in itself is a package inside pip (inception?) Assuming you want to install pip 18.1, download this whl file and then run it like so:
pip install pip‑18.1‑py2.py3‑none‑any.whl
This will work the same way for any other python package as well. Just search and download the correct version matching your python version.
Upvotes: 1