ERROR: Could not find a version that satisfies the requirement reticker

Edit:
I just saw this on the reticker repo. :frowning:

Python ≥3.8 is required. To install, run

In case of the unlikelihood that you are also looking to use reticker and streamlit is still using python 3.7 you can create a reticker.py file in your repo and paste the below code and it should work without any other updates to your code base.

import re

class TickerMatchConfig:
    """Ticker match configuration."""

    def __init__(self, *, unprefixed_uppercase=True, prefixed_lowercase=True, prefixed_titlecase=True):
        """Return the ticker matching configuration.
        Note that a prefixed uppercase ticker, e.g. $SPY, is always matched.
        :param unprefixed_uppercase: Match SPY.
        :param prefixed_lowercase: Match $spy
        :param prefixed_titlecase: Match $Spy.
        """
        self.unprefixed_uppercase = unprefixed_uppercase
        self.prefixed_lowercase = prefixed_lowercase
        self.prefixed_titlecase = prefixed_titlecase


class TickerExtractor:
    """Ticker extractor."""

    def __init__(self, *, deduplicate=True, match_config=None):
        """Return the ticker extractor.
        :param deduplicate: Deduplicate the results.
        :param match_config: Optional match configuration.
        """
        self.deduplicate = deduplicate
        self.match_config = match_config or TickerMatchConfig()

    @property
    def pattern(self):
        """Return the regular expression pattern to find possible tickers.
        This does not use the blacklist.
        """
        match_config = self.match_config
        pattern_format = r"\b{pattern}\b"
        pos_prefix, neg_prefix = r"(?<=\$)", r"(?<!\$)"
        patterns = [pos_prefix + r"[A-Z]{1,6}"]  # Match prefixed uppercase.

        if match_config.unprefixed_uppercase:
            patterns.append(neg_prefix + r"[A-Z]{2,6}")
        if match_config.prefixed_lowercase:
            patterns.append(pos_prefix + r"[a-z]{1,6}")
        if match_config.prefixed_titlecase:
            patterns.append(pos_prefix + r"[A-Z]{1}[a-z]{2,5}")

        patterns = [pattern_format.format(pattern=pattern)
                    for pattern in patterns]
        pattern = re.compile("|".join(patterns), flags=re.ASCII)
        return pattern

    def extract(self, text):
        """Return possible tickers extracted from the given text."""
        blacklist = set()
        matches = [match.upper() for match in self.pattern.findall(text)]
        if self.deduplicate:
            matches = list(dict.fromkeys(matches))
        matches = [match for match in matches if match not in blacklist]
        return matches

Original Post:

Streamlit Sharing is unable to download the package reticker when building the app.

Below is the snippet from the log.

ERROR: Could not find a version that satisfies the requirement reticker==1.0.3
ERROR: No matching distribution found for reticker==1.0.3

When I remove the package from the requirements.txt it deploys just fine as seen in the link below.

https://share.streamlit.io/gardnmi/fundamental-stock-prediction

github repo

There are no issues when ran on my local machine.

NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
1 Like

Thanks for sharing @gardnmi, and welcome to the Streamlit community!

The ability to switch Python versions on Streamlit sharing is a feature we are working on, and hopefully will be released in the coming weeks. In the meantime, you can also use conda to install packages, which also includes the ability to state the version of Python you want to use:

Best,
Randy