我需要阅读并获得.docx中段落的样式(在本例中为强),因此我尝试使用以下方法安装python-docx
包(anacondapv3.9和pv2.7)
pip install python-docx
但我得到的错误如下:
(python27) C:\Users\Alberto\.anaconda>pip install python-docx
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000476D148>: Failed to establish a new connection: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions',)': /simple/python-docx/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000476D6C8>: Failed to establish a new connection: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions',)': /simple/python-docx/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000476DAC8>: Failed to establish a new connection: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions',)': /simple/python-docx/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000476DEC8>: Failed to establish a new connection: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions',)': /simple/python-docx/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000000000479D308>: Failed to establish a new connection: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions',)': /simple/python-docx/
ERROR: Could not find a version that satisfies the requirement python-docx (from versions: none)
ERROR: No matching distribution found for python-docx
在python3.9中:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BEA5A7CBE0>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions')': /simple/python-docx/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BEA219DB80>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions')': /simple/python-docx/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BEA5A78F70>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions')': /simple/python-docx/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BEA5A78D60>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions')': /simple/python-docx/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BEA59DC250>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions')': /simple/python-docx/
ERROR: Could not find a version that satisfies the requirement python-docx (from versions: none)
ERROR: No matching distribution found for python-docx
发布于 2022-10-15 20:42:42
如果这个版本对你有用,你能试一下这个版本并更新吗?
pip install python-docx=0.8.11
我试着在python3.9上安装,这个版本对我有用。
干杯..。
https://stackoverflow.com/questions/74082776
复制相似问题