Home > Enterprise >  Issue while installing python
Issue while installing python

Time:09-21

I was reinstalling python to try to fix a problem i had, from there till now I can't find a solution to this problem.

The problem is that everytime I try to reinstall python, python scripts folder is always empty, meaning pip is not installed and I can't install anything.

I tried:

  • Reinstalling on a different disc.
  • Reinstalling with admin mode.
  • Reinstalling a different version of python.
  • Reinstalling the latest version of python.
  • Reinstalling with different parameters.

I can't find the solution anywhere.

I'm using windows 10 latest version

when I try to install pip using get-pip.py:

Traceback (most recent call last):
  File "C:\Users\Alex\Downloads\get-pip.py", line 23704, in <module>
    main()
  File "C:\Users\Alex\Downloads\get-pip.py", line 198, in main
    bootstrap(tmpdir=tmpdir)
  File "C:\Users\Alex\Downloads\get-pip.py", line 83, in bootstrap
    from pip._internal.commands.install import InstallCommand
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_internal\commands\install.py", line 17, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_internal\cli\req_command.py", line 16, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_internal\index\collector.py", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_vendor\requests\__init__.py", line 125, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_vendor\requests\utils.py", line 27, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_vendor\requests\_internal_utils.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpazxzhdqd\pip.zip\pip\_vendor\requests\compat.py", line 65, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
  File "<frozen importlib._bootstrap_external>", line 982, in get_code
  File "<frozen importlib._bootstrap_external>", line 1040, in get_data
OSError: [Errno 9] Bad file descriptor

When i try to install pip using ensurepip:

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "D:\Python39\lib\runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "D:\Python39\lib\runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "D:\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\__main__.py", line 29, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\cli\main.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\cli\autocompletion.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\cli\main_parser.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\cli\cmdoptions.py", line 23, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\cli\parser.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\configuration.py", line 21, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_internal\exceptions.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_vendor\requests\__init__.py", line 135, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_vendor\requests\utils.py", line 28, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_vendor\requests\_internal_utils.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "C:\Users\Alex\AppData\Local\Temp\tmpfgi7l1sl\pip-21.2.3-py3-none-any.whl\pip\_vendor\requests\compat.py", line 65, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
  File "<frozen importlib._bootstrap_external>", line 982, in get_code
  File "<frozen importlib._bootstrap_external>", line 1040, in get_data
OSError: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "D:\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Python39\lib\ensurepip\__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "D:\Python39\lib\ensurepip\__init__.py", line 210, in _main
    return _bootstrap(
  File "D:\Python39\lib\ensurepip\__init__.py", line 129, in _bootstrap
    return _run_pip(args   [p[0] for p in _PROJECTS], additional_paths)
  File "D:\Python39\lib\ensurepip\__init__.py", line 38, in _run_pip
    return subprocess.run([sys.executable, "-c", code], check=True).returncode
  File "D:\Python39\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['D:\\Python39\\python.exe', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\Alex\\\\AppData\\\\Local\\\\Temp\\\\tmpfgi7l1sl\\\\setuptools-57.4.0-py3-none-any.whl\', \'C:\\\\Users\\\\Alex\\\\AppData\\\\Local\\\\Temp\\\\tmpfgi7l1sl\\\\pip-21.2.3-py3-none-any.whl\']   sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\Alex\\\\AppData\\\\Local\\\\Temp\\\\tmpfgi7l1sl\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.

CodePudding user response:

I somehow installed python successfully.

If someone else has this problem:

  1. Uninstall python completely from your computer
  2. Install python on C: (disc where windows is installed)
  3. Restart your computer
  4. Uninstall python from C:
  5. Open python installation as administrator
  6. Check Add to path
  7. Click on Customize installation
  8. Check everything except install for all users and download debug binaries
  9. The install location should be any disc except C: (e.g: D:, E:, F:)
  10. Click install and wait untill it installs
  • Related