Error deploying Streamlit app

I am attempting to deploy my Streamlit app and am receiving the following error:

Preparing metadata ( started
Preparing metadata ( finished with status ‘error’
error: subprocess-exited-with-error
× python egg_info did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File “”, line 36, in
File “”, line 34, in
File “/var/tmp/pip-install-gidj3yj9/pathlib_e29c12ab423d48a59ddf40b6e74575dc/”, line 30, in
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_distutils/”, line 109, in setup
_setup_distribution = dist = klass(attrs)
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/”, line 456, in init
for ep in metadata.entry_points(group=‘distutils.setup_keywords’):
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/”, line 999, in entry_points
return SelectableGroups.load(eps).select(**params)
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/”, line 449, in load
ordered = sorted(eps, key=by_group)
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/”, line 997, in
dist.entry_points for dist in unique(distributions())
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/”, line 609, in entry_points
return EntryPoints._from_text_for(self.read_text(‘entry_points.txt’), self)
File “/home/appuser/venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/”, line 917, in read_text
return self._path.joinpath(filename).read_text(encoding=‘utf-8’)
AttributeError: ‘PosixPath’ object has no attribute ‘read_text’
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

My requirements.txt is:


I can’t find anyone online with the same issue. Any help would be greatly appreciated. Thank you.

Hey @Defqon7

This seems like a conflict with the Pathlib library.
It actually comes pre-installed with Python and when seperately installed, results in this error.
I would suggest you to remove it from the requirements file and try deploying again.

Read this discussion here (python - Weasyprint get undefined property at invoking write_pdf: "AttributeError: 'PosixPath' object has no attribute 'read_text'" - Stack Overflow) to know more.


1 Like