No matching distribution found for ast

I am trying to import python ast module by adding that in requirements.txt. But I am getting the below error.

Downloading AST-0.0.2.tar.gz (19 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/appuser/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ihtbq7kj/ast_e06eb326322f4ba4a62f0ac507caad12/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ihtbq7kj/ast_e06eb326322f4ba4a62f0ac507caad12/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-p2rry8d2
         cwd: /tmp/pip-install-ihtbq7kj/ast_e06eb326322f4ba4a62f0ac507caad12/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ihtbq7kj/ast_e06eb326322f4ba4a62f0ac507caad12/setup.py", line 6, in <module>
        README = codecs.open(os.path.join(here, 'AST/README'), encoding='utf8').read()
      File "/usr/local/lib/python3.9/codecs.py", line 905, in open
        file = builtins.open(filename, mode, buffering)
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-ihtbq7kj/ast_e06eb326322f4ba4a62f0ac507caad12/AST/README'

How to go about it?

1 Like

Hi @SHRREYA_SINGH, welcome to the Streamlit community!

AST is part of the Python standard library, so including it in the requirements.txt file will cause an error. Removing it fixes the error.

Best,
Randy

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.