pypa / get-pip

Helper scripts to install pip, in a Python installation that doesn't have it.
https://bootstrap.pypa.io/pip/
MIT License
738 stars 293 forks source link

Number error #192

Closed AbdulRahman7861234 closed 1 year ago

AbdulRahman7861234 commented 1 year ago

When run the python code, get-pip.py, get the following error: 1 2 3 4 5 [1, 2, 3, 4, 5] Traceback (most recent call last): File "C:\Users\AbdulRahman\python\get-pip.py", line 32321, in main() File "C:\Users\AbdulRahman\python\get-pip.py", line 135, in main bootstrap(tmpdir=tmpdir) File "C:\Users\AbdulRahman\python\get-pip.py", line 111, in bootstrap monkeypatch_for_cert(tmpdir) File "C:\Users\AbdulRahman\python\get-pip.py", line 92, in monkeypatch_for_cert from pip._internal.commands.install import InstallCommand File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_internal\commands__init__.py", line 9, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_internal\cli\base_command.py", line 13, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich\traceback.py", line 31, in

^

File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich\columns.py", line 7, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich\console.py", line 63, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich\scope.py", line 7, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich\table.py", line 17, in File "C:\Users\ABDULR~1\AppData\Local\Temp\tmp8gf3k04j\pip.zip\pip_vendor\rich_ratio.py", line 2, in File "C:\Users\AbdulRahman\AppData\Local\Programs\Python\Python311\Lib\fractions.py", line 6, in from decimal import Decimal File "C:\Users\AbdulRahman\AppData\Local\Programs\Python\Python311\Lib\decimal.py", line 3, in from _decimal import * AttributeError: module 'numbers' has no attribute 'Number'. Did you mean: 'numbers'?

pradyunsg commented 1 year ago

Hi! :)

Do you have a numbers.py file in the folder you're running this script in?

Specifically, C:\Users\AbdulRahman\python\numbers.py

Python might be importing that module, when there's an import numbers, which shadows https://docs.python.org/3/library/numbers.html (a module with the same name in the Python standard library)!

Consider renaming the numbers.py file in your python folder, or run get-pip.py from a different directory.