I needed to go through stack traces to find the following dependencies:
pytz
editor
jsonschema
prompt_toolkit
Fixed by:
sudo pip install pytz
sudo pip install editor
sudo pip install jsonschema
sudo pip install prompt_toolkit
How did you install st2client? Some of those dependencies - e.g. pytz - are covered in https://github.com/StackStorm/st2/blob/master/st2client/requirements.txt
I too am unable to get st2client installed, have tried both Python 2.7 or Python 3.6 using pip install and falling down a rabbit whole of dependency. Installing a OS X.
Traceback (most recent call last):
File "/usr/local/bin/st2", line 7, in <module>
from st2client.shell import main
File "/usr/local/lib/python2.7/site-packages/st2client/shell.py", line 39, in <module>
from st2client.commands import pack
File "/usr/local/lib/python2.7/site-packages/st2client/commands/pack.py", line 18, in <module>
import editor
ImportError: No module named editor
Finally got working after manually running sudo pip install python-editoras well as the above
The dependency is there though. I would also like to know how you're installing st2client, it might that we missed something during, say, packaging....
Just using pip install st2client
The problem occurs when installing via pypi (system or user):
pip install st2client [--user]
The reason is that the requirements in st2client/setup.py do not match with st2client/requirements.txt.
It looks like all of the changes to requirements.txt did not make it into setup.py since Jan 25, 2016, commit de658418f. The following are in requirements.txt, but not setup.py (and the commit they were added in).
pytz (a02ee139ef)argcomplete (c8d273c5f)python-editor (29f441880b)prompt-toolkit (f41248322a8fd)sseclient (8049af601a)These version requirements don't match (requirements.txt vs setup.py):
requests[security]<2.12,>=2.11.1 vs requests<3.0,>=2.7.0 (changed in commit 8049af601a)To avoid setup.py and requirements.txt getting out of sync, requirements.txt could be replaced with something simpler, as described here: https://caremad.io/posts/2013/07/setup-vs-requirement/
Would that be acceptable? If not, what's st2's preferred method for keeping requirements.txt and setup.py in sync?
This is still an issue, the package on pypi needs the following installed before it is usable:
pip install argcomplete pytz jsonschema prompt_toolkit python-editor
@j3p0uk Thanks for reporting.
I need to check, because we did update setup.py in the past, but it's possible it's still out of sync.
I can confirm this is still an issue, I setup a virtualenv on MacOS using pipenv and had to install the packages listed above.
st2 2.7.2, on Python 2.7
@jjm I believe #4209 should solve that (I will verify it now).
It's targeted for v2.8.1 / v2.9.0 release.
@jjm I confirmed that changes in #4209 indeed fix this issue by running the following command in a fresh virtual environment:
pip install -e "git+https://github.com/stackstorm/st2.git@setup_reqs#egg=st2client&subdirectory=st2client"
@Kami Cool. Thank you very much 馃憤
Most helpful comment
The problem occurs when installing via pypi (system or user):
pip install st2client [--user]The reason is that the requirements in st2client/setup.py do not match with st2client/requirements.txt.
It looks like all of the changes to requirements.txt did not make it into setup.py since Jan 25, 2016, commit de658418f. The following are in requirements.txt, but not setup.py (and the commit they were added in).
pytz(a02ee139ef)argcomplete(c8d273c5f)python-editor(29f441880b)prompt-toolkit(f41248322a8fd)sseclient(8049af601a)These version requirements don't match (requirements.txt vs setup.py):
requests[security]<2.12,>=2.11.1vsrequests<3.0,>=2.7.0(changed in commit 8049af601a)