Command errored out with exit status 1 python

In this Python tutorial, we will see how to fix the error, Command errored out with exit status 1 in Python.

The error was coming when I was trying to install the Python strings module by running the below command:

pip install strings

The complete error was coming like below:

ERROR: Command errored out with exit status 1:
command: ‘c:\python\python38\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘C:\Users\Administrator.SHAREPOINTSKY\AppData\Local\Temp\pip-install-e261r6ji\strings\setup.py'”‘”‘; file='”‘”‘C:\Users\Administrator.SHAREPOINTSKY\AppData\Local\Temp\pip-install-e261r6ji\strings\setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(file);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, file, ‘”‘”‘exec'”‘”‘))’ egg_info –egg-base ‘C:\Users\Administrator.SHAREPOINTSKY\AppData\Local\Temp\pip-pip-egg-info-hu8mfm_g’
cwd: C:\Users\Administrator.SHAREPOINTSKY\AppData\Local\Temp\pip-install-e261r6ji\strings\
Complete output (5 lines):
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\Administrator.SHAREPOINTSKY\AppData\Local\Temp\pip-install-e261r6ji\strings\setup.py”, line 5, in
import strings
ModuleNotFoundError: No module named ‘strings’
—————————————-
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Below image shows the screenshot of error:

Command errored out with exit status 1
Command errored out with exit status 1

Command errored out with exit status 1 python

There was no issue with the command, one file with name string.py was causing the issue.

As you can see below there was filename string.py in the same folder which was causing the issue.

To fix the issue, we need to simply delete the string.py file from the folder.

Ideally, we should not create any file with name as string.py.

Command errored out with exit status 1 python
Command errored out with exit status 1 python

AttributeError: partially initialized module ‘random’ has no attribute ‘randint’

The above same file name (string.py) issue might give the below error also,

AttributeError: partially initialized module ‘random’ has no attribute ‘randint’ (most likely due to a circular import).

READ:  How to Compare Two Strings Character by Character in Python [5 different ways]

Follow the same delete the file solution to fix this issue also.

You may like the following python tutorials:

Here, we learned how to fix the below two errors in Python:

  • Command errored out with exit status 1 python
  • AttributeError: partially initialized module ‘random’ has no attribute ‘randint’