Fixing the ConnectTimeoutError error when installing packages through pip
Written by
Updated at December 17, 2025
Issue description
When installing new Python packages in a project, DataSphere returns this error:
% pip install langchain
Defaulting to user installation because normal site-packages is not writeable
WARNING: Retrying (Retry (total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by; ConnectTimeoutError(pip._v endor.urllib3.connection.HTTPSConnection object at 0x7f711cb08df0;
Connection to pypi.org timed out. (connect timeout=15))
Solution
Make sure you specified the subnet in your project; in its settings, you should specify the NAT gateway to connect to the internet. You can learn how to set up a NAT gateway in this guide.
If it does not help, remove the security group and subnet from the advanced project settings.