0

I had installed Python 3.7.4, and it doesn't install pip.

Install Python with IDLE and obviously with pip. But when I want to install pip, it shows this error.

Traceback (most recent call last):

File "get-pip.py", line 22312, in <module>
    main()

File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)

File "get-pip.py", line 82, in bootstrap
    import pip._internal

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\__init__.py", line 40, in <module>

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\cli\autocompletion.py", line 8, in <module>

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\cli\main_parser.py", line 11, in <module>

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\commands\__init__.py", line 6, in <module>

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\commands\completion.py", line 6, in <module>

File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\cli\base_command.py", line 21, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_internal\download.py", line 14, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_vendor\requests\__init__.py", line 114, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_vendor\requests\utils.py", line 26, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_vendor\requests\_internal_utils.py", line 11, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked

  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible

  File "C:\Users\Hp\AppData\Local\Temp\tmp7m70r5qb\pip.zip\pip\_vendor\requests\compat.py", line 64, in <module>

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 724, in exec_module

  File "<frozen importlib._bootstrap_external>", line 859, in get_code

  File "<frozen importlib._bootstrap_external>", line 917, in get_data

OSError: [Errno 9] Bad file descriptor

I am stuck and spent lots of hours. Any help will be appreciated.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • 2
    What exactly action exactly gives you the posted stack trace? Something you called on command line? The press of some button? Please be more specific – Finomnis Sep 07 '19 at 15:16
  • 1
    if you installed Python with `pip`, why do you want to install it again? can you call `python -m pip --version` in cmd/ps? – FObersteiner Sep 07 '19 at 15:18
  • @Finomnis This stack trace is given when I try to install some package from PyPI. – Fahad Iqbal Khan Sep 07 '19 at 15:21
  • @FahadIqbalKhan on command line? Please start without any python installed and then post all the steps you do to reach that error, including programs you install, commands you execute on the command line, etc. – Finomnis Sep 07 '19 at 15:23
  • @MrFuppes I tried it and it shows me this error: C:\Python3.7.4\python.exe: No module named pip – Fahad Iqbal Khan Sep 07 '19 at 15:24
  • @Finomnis I installed Python3.7.4 with custom installation and it's location is C:\Python3.7.4. Then on command line I verified it by "python" command. But when I want to import openpyxl by "pip install openpyxl" command, it give me the error. – Fahad Iqbal Khan Sep 07 '19 at 15:26
  • 2
    @Fahad Please [edit] the question to add the missing info instead of using comments. – wjandrea Sep 07 '19 at 15:26
  • @FahadIqbalKhan: the error is just "-"? nothing else? that's weird... but you can call Python in in cmd? – FObersteiner Sep 07 '19 at 15:27
  • @MrFuppes The error is `C:\Python3.7.4\python.exe: No module named pip`. I think Fahad edited his comment. – wjandrea Sep 07 '19 at 15:28
  • @Finomnis. I can't help you if you arent more specific. What python? The normal one from the python.org website? There one from Conda? – Finomnis Sep 07 '19 at 15:29
  • Ok. First real attempt to solve this problem: Did you check "Add python to PATH" during install? If not, this should fix your problem (maybe). – Finomnis Sep 07 '19 at 15:31
  • @Finomnis Yes I checked it. – Fahad Iqbal Khan Sep 07 '19 at 15:34
  • Also, installing packages directly is not the best way to do it. Instead, create a [virtualenv](https://docs.python.org/3/library/venv.html). I this virtualenv, pip should be installed and working. – Finomnis Sep 07 '19 at 15:34
  • Here is more information about VirtualEnvs on Windows: https://www.techcoil.com/blog/how-to-create-a-python-3-virtual-environment-in-windows-10/ – Finomnis Sep 07 '19 at 15:35
  • @wjandrea - I see. So the Windows environment variable ´path` should be correct (path to Python installation included) as python.exe is called. Although virtual envs are the way to go if you go serious on development - `pip` should be there after the installation nevertheless... checked [this](https://stackoverflow.com/questions/32639074/why-am-i-getting-importerror-no-module-named-pip-right-after-installing-pip)? – FObersteiner Sep 07 '19 at 15:43
  • @FahadIqbalKhan go to uninstall apps==> then click on python and u will get a option like Repair then see this, [image](https://www.howtogeek.com/wp-content/uploads/2017/05/img_591a09e55df0e.png) select pip and python.exe to the path and after that it will work – sai Pavan Kumar Sep 07 '19 at 15:49

0 Answers0