mborsetti / webchanges

webchanges anonymously checks web content (including images) and commands for changes, delivering instant notifications and AI-powered summaries to your favorite platform.
https://pypi.org/project/webchanges/
Other
37 stars 6 forks source link

Dependency installation failing using prescribed method #18

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am trying to install dependencies according to instructions but am getting a failed response.

May I just install them using pip install dependency?

I am using pyenv for my python install on macOS Big Sur.

$ pip install --upgrade webchanges[use_browser]
zsh: no matches found: webchanges[use_browser]

$ type webchanges
webchanges is /Users/john/.pyenv/shims/webchanges

$ type pip
pip is /Users/john/.pyenv/shims/pip

$ which pip
/Users/john/.pyenv/shims/pip

$ pip -V
pip 21.2.4 from /Users/john/.pyenv/versions/3.9.7/lib/python3.9/site-packages/pip (python 3.9)

$ pip install webchanges
Requirement already satisfied: webchanges in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (3.8.3)
Requirement already satisfied: cssselect in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (1.1.0)
Requirement already satisfied: markdown2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.4.1)
Requirement already satisfied: requests in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.26.0)
Requirement already satisfied: platformdirs in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.3.0)
Requirement already satisfied: pyyaml in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (5.4.1)
Requirement already satisfied: lxml in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (4.6.3)
Requirement already satisfied: html2text in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2020.1.16)
Requirement already satisfied: msgpack in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (1.0.2)
Requirement already satisfied: certifi>=2017.4.17 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (2021.5.30)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (1.26.6)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (2.0.6)
Requirement already satisfied: idna<4,>=2.5 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (3.2)

$ pip list
Package            Version
------------------ ---------
certifi            2021.5.30
charset-normalizer 2.0.6
cssselect          1.1.0
html2text          2020.1.16
idna               3.2
lxml               4.6.3
markdown2          2.4.1
msgpack            1.0.2
pip                21.2.4
platformdirs       2.3.0
PyYAML             5.4.1
requests           2.26.0
setuptools         58.0.4
urllib3            1.26.6
webchanges         3.8.3

EDIT: Are we not supposed to include brackets?

$ pip install webchanges use_browser -U
Requirement already satisfied: webchanges in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (3.8.3)
ERROR: Could not find a version that satisfies the requirement use_browser (from versions: none)
ERROR: No matching distribution found for use_browser

EDIT2: found the correct format

$ pip install --upgrade webchanges pushover
Requirement already satisfied: webchanges in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (3.8.3)
Collecting pushover
  Downloading pushover-0.5-py3-none-any.whl (3.0 kB)
Requirement already satisfied: pyyaml in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (5.4.1)
Requirement already satisfied: platformdirs in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.3.0)
Requirement already satisfied: html2text in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2020.1.16)
Requirement already satisfied: requests in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.26.0)
Requirement already satisfied: markdown2 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (2.4.1)
Requirement already satisfied: lxml in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (4.6.3)
Requirement already satisfied: msgpack in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (1.0.2)
Requirement already satisfied: cssselect in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from webchanges) (1.1.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (2021.5.30)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (2.0.6)
Requirement already satisfied: idna<4,>=2.5 in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (from requests->webchanges) (3.2)
Installing collected packages: pushover
Successfully installed pushover-0.5

Suggestion: In your example code don't include brackets. Just use the code as it should be entered - sans brackets. The wording and the example work together to make it seem as though they are a required part of the command.

as shown:

pip install --upgrade webchanges[use_browser]
pip install --upgrade webchanges[use_browser,redis]

whereas this is the correct command:

pip install --upgrade webchanges pushover

Using the new format some dependencies aren't found:

$ pip install --upgrade webchanges safe_password
Requirement already satisfied: webchanges in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (3.8.3)
ERROR: Could not find a version that satisfies the requirement safe_password (from versions: none)
ERROR: No matching distribution found for safe_password

$ pip install --upgrade webchanges use_browser  
Requirement already satisfied: webchanges in ./.pyenv/versions/3.9.7/lib/python3.9/site-packages (3.8.3)
ERROR: Could not find a version that satisfies the requirement use_browser (from versions: none)
ERROR: No matching distribution found for use_browser
ghost commented 3 years ago

Looks like its a ZSH issue for some reason. Can't understand it.

Not sure what to do because I incorrectly assumed that the command didn't require brackets. In fact pip was seeing it as a list of packages to install. It looks like those packages weren't linked correctly to webchanges.

I switched to the BASH shell and used the syntax you provided and the command worked but now I am thinking I have duplicate packages installed? How can I remove or fix this issue?

mborsetti commented 3 years ago

Thanks for opening the issue.

As you found out, the syntax is for setuptools extras and is correct with brackets as per pip examples. It also works (see below).

I recommend you open an issue with ZSH and/or pip.

I am sorry you had to go through this but it nothing that this project can fix (and I don't use ZSH). But please do update this issue if you find anything useful that can be added to the documentation for future users!

C:\Users\username>pip install --upgrade webchanges[use_browser]
Collecting webchanges[use_browser]
  Downloading webchanges-3.8.3-py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 6.1 MB/s
Requirement already satisfied: colorama in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (0.4.4)
Requirement already satisfied: lxml in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (4.6.3)
Requirement already satisfied: pyyaml in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (5.4.1)
Requirement already satisfied: tzdata in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (2021.1)
Requirement already satisfied: markdown2 in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (2.4.1)
Requirement already satisfied: platformdirs in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (2.3.0)
Requirement already satisfied: requests in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (2.26.0)
Requirement already satisfied: msgpack in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (1.0.2)
Requirement already satisfied: html2text in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (2020.1.16)
Requirement already satisfied: cssselect in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (1.1.0)
Requirement already satisfied: pyppeteer in c:\program files\python\python39\lib\site-packages (from webchanges[use_browser]) (0.2.6)
Requirement already satisfied: importlib-metadata>=1.4 in c:\program files\python\python39\lib\site-packages (from pyppeteer->webchanges[use_browser]) (4.8.1)
Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in c:\program files\python\python39\lib\site-packages (from pyppeteer->webchanges[use_browser]) (4.62.2)
Collecting websockets<10.0,>=9.1
  Using cached websockets-9.1-cp39-cp39-win_amd64.whl (90 kB)
Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in c:\program files\python\python39\lib\site-packages (from pyppeteer->webchanges[use_browser]) (1.26.6)
Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in c:\program files\python\python39\lib\site-packages (from pyppeteer->webchanges[use_browser]) (1.4.4)
Requirement already satisfied: pyee<9.0.0,>=8.1.0 in c:\program files\python\python39\lib\site-packages (from pyppeteer->webchanges[use_browser]) (8.2.2)
Requirement already satisfied: zipp>=0.5 in c:\program files\python\python39\lib\site-packages (from importlib-metadata>=1.4->pyppeteer->webchanges[use_browser]) (3.5.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\program files\python\python39\lib\site-packages (from requests->webchanges[use_browser]) (2021.5.30)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\program files\python\python39\lib\site-packages (from requests->webchanges[use_browser]) (2.0.6)
Requirement already satisfied: idna<4,>=2.5 in c:\program files\python\python39\lib\site-packages (from requests->webchanges[use_browser]) (3.2)
Installing collected packages: websockets, webchanges
Successfully installed webchanges-3.8.3 websockets-9.1
ghost commented 3 years ago

I just moved from bash to zsh a day ago so... bound to be "features" I am unaware of. Hope this helps others. Maybe include this in your documentation?

In zsh shell [ does pattern matching. Brackets need to be escaped: \[package\]

$ python -m pip install --upgrade webchanges\[use_browser\]