Issue
I have few dependencies in a project listed in the requirements.txt
file,
requests==2.18.4
secrets==1.0.2
PyYAML==3.12
I wanted to installed them and called the command inside the virtualenv
,
$ pip install -r bin/requirements.txt
I get the message provided below,
Collecting requests==2.18.4 (from -r bin/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Could not find a version that satisfies the requirement secrets==1.0.2 (from -r bin/requirements.txt (line 2)) (from versions: )
No matching distribution found for secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Inside the virtualenv
, I can have the versions provided,
$ python -V
Python 3.7.2
$ pip -V
pip 19.0.3 from /Users/chaklader/PycharmProjects/Welance-Craft/env/lib/python3.7/site-packages/pip (python 3.7)
Whats the issue here?
Update
I had to delete the secrets
and update the other dependencies:
requests==2.21.0
PyYAML==3.13
Solution
While there is a secrets package, it’s very old (2012), has only one release, a broken website, and no info. It doesn’t appear to install on Python 2.7 or 3.7.
You may instead be trying to use the secrets
standard library that’s built-in to Python 3.6+. It’s not a package, so you don’t need to install it or add it to your requirements.txt
, simply import secrets
. If you need it for an earlier version, there does appear to be an unofficial backport.
Answered By - Andrew Marshall Answer Checked By - Terry (WPSolving Volunteer)