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 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.
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).
Follow the same delete the file solution to fix this issue also.
You may like the following python tutorials:
- Python epoch to DateTime + Examples
- Priority queue in Python
- Python 3 pickle typeerror a bytes-like object is required not ‘str’
- Python binary search and linear search
- Sorting algorithms in Python
- Working with JSON data in Python
- Python GUI Programming
- Increment and Decrement operators in Python
- Constructor in Python
- How to convert dictionary to JSON in Python
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’
I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.