I made a file named area_config.json
for a completely different project that has since been deleted and I started a new project. When I went to install some libraries I needed for the project with pip I got this error message:
S C:UserstayshOneDriveDocumentspixel_selection.py> pip install pyautogui
Error loading config: [Errno 2] No such file or directory: 'area_config.json'
Failed to load configuration.
This program was made in an entirely different folder from the first and at no point calls for area_config.json
.
My code:
from pynput import mouse
import pyautogui
import time
start_x = start_y = end_x = end_y = None
drawing = False
def on_click(x, y, button, pressed):
global start_x, start_y, end_x, end_y, drawing
if button == mouse.Button.left:
if pressed:
if not drawing:
# Start drawing the box
start_x, start_y = x, y
drawing = True
else:
# End drawing the box
end_x, end_y = x, y
drawing = False
# Print out the coordinates
print(f"Box coordinates: ({start_x}, {start_y}) to ({end_x}, {end_y})")
print("Top-left:", (min(start_x, end_x), min(start_y, end_y)))
print("Bottom-right:", (max(start_x, end_x), max(start_y, end_y)))
print("Top-right:", (max(start_x, end_x), min(start_y, end_y)))
print("Bottom-left:", (min(start_x, end_x), max(start_y, end_y)))
print()
def main():
with mouse.Listener(on_click=on_click) as listener:
listener.join()
if __name__ == "__main__":
main()
This is not the only project this is happening to and it seems all my projects are getting this error message, projects that already have the libraries they need seem fine to run, but since I can’t install libraries with this new error message I get the error for not having them when I attempt to run the project.
I tried looking up the error code and got nothing and also looking at other people’s problems on here and still saw nothing that helped.
Tayshawn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.