I had this error when i tried to do: pip install pyinstaller.
So please help me with this error i got because i have been searching for ages to fix this error.
The error line when i tried to install pyinstaller using PIP:
C:\Users\Admin\Documents\Code>pip install pyinstaller
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\__main__.py", line 26, in <module>
sys.exit(_main())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
from pip._internal.index.package_finder import PackageFinder
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\index\package_finder.py", line 21, in <module>
from pip._internal.index.collector import parse_links
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\index\collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\requests\__init__.py", line 114, in <module>
from . import utils
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\requests\utils.py", line 27, in <module>
from ._internal_utils import to_native_string
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\requests\_internal_utils.py", line 11, in <module>
from .compat import is_py2, builtin_str, str
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\requests\compat.py", line 65, in <module>
from http.cookies import Morsel
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 779, in exec_module
File "<frozen importlib._bootstrap_external>", line 915, in get_code
File "<frozen importlib._bootstrap_external>", line 973, in get_data
OSError: [Errno 9] Bad file descriptor
If hippozhipos's comment does not work, you could try to install Python from www.python.org instead of the Microsoft Store. Make sure to tick the "add python to PATH" box in the installation process.
It looks like you're using python 3.8
try: py -3.8 -m pip install pyinstaller
This worked for me when I had a similar problem.
if you're installing this in a virtual environment, you can also do:
PathToVirtualEnv\Scripts\Python -m pip install pyinstaller
Related
Dependencies on html5lib are pretty broad across developer tools on Linux. I uncovered this issue while attempting to implement the selenium test suite for my Django app. When I attempt to pip install, I receive the below error. How do I adjust my system to grab and install html5lib?
Traceback (most recent call last):
File "/home/satch/.local/bin/pip", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 104,
in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24,
in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 16,
in <module>
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21,
in <module>
from pip._internal.index.collector import parse_links
File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 14,
in <module>
from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor'
(/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)
I am using python3.8.8 in windows10. I just typed pip list in
venv(CMD) which showed a big error. I was using this venv for pip
installing tensorflow which also showed this similar error
## Heading ## (venv) C:\Users\HP>pip list Traceback (most recent
call last): File
"c:\users\hp\appdata\local\programs\python\python38\lib\runpy.py",
line 194, in _run_module_as_main
return _run_code(code, main_globals, None, File "c:\users\hp\appdata\local\programs\python\python38\lib\runpy.py",
line 87, in _run_code
exec(code, run_globals) File "C:\Users\HP\venv\Scripts\pip.exe\__main__.py", line 7, in <module>
File "c:\users\hp\venv\lib\site-packages\pip\_internal\cli\main.py",
line 71, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args)) File
"c:\users\hp\venv\lib\site-packages\pip\_internal\commands\__init__.py",
line 96, in create_command
module = importlib.import_module(module_path) File "c:\users\hp\appdata\local\programs\python\python38\lib\importlib\__init__.py",
line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in
_find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen
importlib._bootstrap_external>", line 783, in exec_module File
"<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed File "c:\users\hp\venv\lib\site-packages\pip\_internal\commands\list.py",
line 5, in <module>
from pip._internal.cli.req_command import IndexGroupCommand File
"c:\users\hp\venv\lib\site-packages\pip\_internal\cli\req_command.py",
line 16, in <module>
from pip._internal.index.collector import LinkCollector File "c:\users\hp\venv\lib\site-packages\pip\_internal\index\collector.py",
line 16, in <module>
from pip._vendor import html5lib, requests File "c:\users\hp\venv\lib\site-packages\pip\_vendor\html5lib\__init__.py",
line 25, in <module>
from .html5parser import HTMLParser, parse, parseFragment File "c:\users\hp\venv\lib\site-packages\pip\_vendor\html5lib\html5parser.py",
line 6, in <module>
from . import _inputstream File "c:\users\hp\venv\lib\site-packages\pip\_vendor\html5lib\_inputstream.py",
line 10, in <module>
from pip._vendor import webencodings ImportError: cannot import name 'webencodings' from 'pip._vendor'
(c:\users\hp\venv\lib\site-packages\pip\_vendor\__init__.py)
Here is the stacktrace I get from pip. I'm running Windows 10.
What to do here?
I can see the pip version and other options with main but can't download / install any packages.
D:\Python>python.exe -m pip install --upgrade pip
Traceback (most recent call last):
File "D:\Python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "D:\Python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Python\lib\site-packages\pip\__main__.py", line 26, in <module>
sys.exit(_main())
File "D:\Python\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "D:\Python\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "D:\Python\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
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 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\Python\lib\site-packages\pip\_internal\commands\install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "D:\Python\lib\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
from pip._internal.index.package_finder import PackageFinder
File "D:\Python\lib\site-packages\pip\_internal\index\package_finder.py", line 21, in <module>
from pip._internal.index.collector import parse_links
File "D:\Python\lib\site-packages\pip\_internal\index\collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "D:\Python\lib\site-packages\pip\_vendor\html5lib\__init__.py", line 25, in <module>
from .html5parser import HTMLParser, parse, parseFragment
File "D:\Python\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 7, in <module>
from . import _inputstream
File "D:\Python\lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 9, in <module>
from pip._vendor import webencodings
ImportError: cannot import name 'webencodings' from 'pip._vendor' (D:\Python\lib\site-packages\pip\_vendor\__init__.py)
This is due to broken build process just revert the pip version.
Try this:
$ pip install -U "pip<20" setuptools
I'm trying to list pip packages, but when I run pip list, I get this error message
Traceback (most recent call last):
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Ben\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe\__main__.py", line 7, in <module>
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\commands\list.py", line 9, in <module>
from pip._internal.cli.req_command import IndexGroupCommand
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
from pip._internal.index.collector import LinkCollector
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\index\collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\html5lib\__init__.py", line 25, in <module>
from .html5parser import HTMLParser, parse, parseFragment
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 6, in <module>
from . import _inputstream
File "c:\users\ben\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 10, in <module>
from pip._vendor import webencodings
ValueError: source code string cannot contain null bytes
I thought it was just a problem with the list command and forgot about it, so I installed a pip package. However, when I put the command in, I still got the same error message. Pip was working fine before so I don't know if there's a problem with a piece of code I need to fix or something.
when i tried to install netfilterqueue this error came up.
even i can't uninstall/check/install using pip.
And i searched over the stackoverflow and one of those said use :
sudo pip install -U setuptools
And again this error came up.
Traceback (most recent call last):
File "/usr/bin/pip", line 33, in <module>
sys.exit(load_entry_point('pip==20.1.1', 'console_scripts', 'pip')())
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
from pip._internal.operations.prepare import RequirementPreparer
File "/usr/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 15, in <module>
from pip._internal.distributions import (
File "/usr/lib/python3.8/site-packages/pip/_internal/distributions/__init__.py", line 2, in <module>
from pip._internal.distributions.wheel import WheelDistribution
File "/usr/lib/python3.8/site-packages/pip/_internal/distributions/wheel.py", line 5, in <module>
from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel
File "/usr/lib/python3.8/site-packages/pip/_internal/utils/wheel.py", line 12, in <module>
from pip._vendor.six import PY2, ensure_str
ImportError: cannot import name 'ensure_str' from 'six' (/usr/lib/python3.8/site-packages/six.py)
Thanks in advance.
I was able to make this work by copying six.py from https://github.com/benjaminp/six.git into /usr/lib/python3.8/six.py ... you'll need sudo to create or update this file.