How to fix OSError: [WinError 123] when publishing to PyPi

How to fix OSError: [WinError 123] when publishing to PyPi

完整错误:

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\Program Files\GDAL"'

为什么 Python 在我 运行 以下内容时寻找文件 C:\Program Files\GDAL"?

python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

我什至在我的 C:/Program files 文件夹中创建了一个名为 GDAL 的文件夹,但它仍然无法正常工作?为什么要把包上传到 PyPi 这么痛苦?!?

好的,所以我想通了 - 结果我的 PYTHONPATH 变量被设置为 C:\Program Files\GDAL" 出于某种未知原因。我将其更改为 C:\Users\\Anaconda3,现在它有效!