After installing boto3 package to integrate with AWS S3 buckets, the application fails on deployment. The Railway error is "botocore 1.34.93 depends on urllib3<1.27 and >=1.25.4; python_version < "3.10". On the local server (127.0.0.1:8000) everything works fine, and app deployed with no issues before installing boto3.
Upon installing boto3, I expected the app to deploy on Railway as it did before installing the package. Any suggestions?
2
Answers
I found a solution: in requirements.txt, I deleted the version requirement for urllib3 which allows Railway to find and install a version of urllib3 that is compatible with boto3 and botocore. By looking at the Railway deployment logs, Railway goes from latest version to newest version until it finds a compatible one.
Something odd about this error is that I never chose a version for urllib3. The version in requirements.txt was selected by the system when I installed boto3. It is odd that the version added to the requirements would be incompatible when deploying.
It probably means that you’re using the latest version of urllib3 (which is a required dependency for botocore to work). You can try to download the required version with the following syntax :
pip install urllib3==<version>
And replace
<version>
by the version you need