Fix pip install codec error on windows
In Python, when you use pip to install packages, the default encoding during the compilation process is not directly determined by Python or pip, but by the default encoding of the compiler and operating system used by Python. We need to set the encoding to avoid compilation failures under different encodings. Here is the error I encountered in my environment:
(quick_trade)` PS C:\Workspace\trade\cxtt> pip install quick-trade Collecting quick-trade Downloading quick_trade-7.9.8.tar.gz (39 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.