OpenAI Gym installation failing with proxy authentication error

I’m having trouble setting up the OpenAI Gym library for reinforcement learning development. Every time I try to install it using pip, I get the same proxy authentication error. I’ve searched online for solutions but nothing has worked so far.

Here’s the command I’m running and the error output:

john@john-laptop:~/rl-env$ sudo pip install -e .[all]

The installation starts fine and finds most dependencies like numpy, requests, and pyglet. But when it tries to download box2d-py, it fails with:

Collecting box2d-py (from gym==0.7.3)
  Retrying after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))'
  Could not find a version that satisfies the requirement box2d-py
No matching distribution found for box2d-py

I also get warnings about cache directory permissions. Has anyone encountered this proxy authentication issue before? What’s the best way to resolve this installation problem?