pleblira
Run Selenium headless browser on Railway using Python
Hey there!
I'm trying to run a Selenium instance in my Railway app, but not able to initialize the driver. Is it possible to run Selenium applications on Railway? Sorry if it's obvious!
I tried a few different things, but can't seem to be able to make the binary for the driver accessible to the application. The application runs locally but not when deployed to Railway.
1 - Using the webdriver_manager module
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
2 - Manually adding geckodriver to the package
driver = webdriver.Firefox('drivers/', options=options)
Source for Selenium portion of the code - https://github.com/pleblira/siggy_scrape_no_pyproject/blob/main/send_tweet.py
Will post the logs in the next message.
Thanks so much in advance.
12 replies
Can't build python application, src folder not being found
Hey there! Looking for some help with deploying a python application to Railway.
It's the first time I'm deploying an application with a pyproject.toml file instead of main.py+requirements.txt.
Source: https://github.com/pleblira/siggy_scrape
If I use
python3 -m build
to create the build and pip install it to an anaconda environment, the application installs and runs fine.
When I try to deploy it to Railway, though, I run into the error below. It seems it can't find the src folder (second to last line)?
Any insight would be greatly appreciated. Thanks so much!
#10 15.21 × Getting requirements to build wheel did not run successfully.
#10 15.21 │ exit code: 1
#10 15.21 ╰─> [6 lines of output]
#10 15.21 /tmp/pip-build-env-0y5be6oy/overlay/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for [tool.setuptools]
in pyproject.toml
is still beta.
#10 15.21 config = read_configuration(filepath, True, ignore_option_errors, dist)
#10 15.21 /tmp/pip-build-env-0y5be6oy/overlay/lib/python3.8/site-packages/setuptools/config/expand.py:132: SetuptoolsWarning: File '/app/README.md' cannot be found
#10 15.21 return '\n'.join(
#10 15.21 running egg_info
#10 15.21 error: error in 'egg_base' option: '/src' does not exist or is not a directory
#10 15.21 [end of output]7 replies