StackStorm / st2sdk

This repository contains different utilities and tools which help with the StackStorm integration pack development.
Apache License 2.0
10 stars 11 forks source link

pip install st2sdk fails, pip install from github works #15

Open nmaludy opened 7 years ago

nmaludy commented 7 years ago

When running pip install st2sdk it fails with the following error

[root@stackstorm bin]# source /opt/stackstorm/st2/bin/activate
(st2) [root@stackstorm bin]# pip install st2sdk
Collecting st2sdk
  Downloading st2sdk-0.2.0.tar.gz
Collecting six<1.10,>=1.9.0 (from st2sdk)
  Downloading six-1.9.0-py2.py3-none-any.whl
Requirement already satisfied: cmd2<0.7,>=0.6.8 in /opt/stackstorm/st2/lib/python2.7/site-packages (from st2sdk)
Collecting jinja2<2.8,>=2.7.3 (from st2sdk)
  Downloading Jinja2-2.7.3.tar.gz (378kB)
    100% |████████████████████████████████| 378kB 2.6MB/s 
Requirement already satisfied: pyparsing>=2.0.1 in /opt/stackstorm/st2/lib/python2.7/site-packages (from cmd2<0.7,>=0.6.8->st2sdk)
Requirement already satisfied: markupsafe in /opt/stackstorm/st2/lib/python2.7/site-packages (from jinja2<2.8,>=2.7.3->st2sdk)
Building wheels for collected packages: st2sdk, jinja2
  Running setup.py bdist_wheel for st2sdk ... done
  Stored in directory: /root/.cache/pip/wheels/b2/f5/4a/17758620d3e39c7d9914d57825fc9994e31f853eb773cdcb32
  Running setup.py bdist_wheel for jinja2 ... done
  Stored in directory: /root/.cache/pip/wheels/ea/d6/b1/389cd2f50d24ce359eb1f4005965da619ef62316226b2d430d
Successfully built st2sdk jinja2
Installing collected packages: six, jinja2, st2sdk
  Found existing installation: six 1.10.0
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Rolling back uninstall of six
Exception:
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pip/locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/setuptools/dist.py", line 320, in __init__
    _Distribution.__init__(self, attrs)
  File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/setuptools/dist.py", line 386, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2324, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 862, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2568, in requires
    dm = self._dep_map
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2815, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2824, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2806, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1468, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/opt/stackstorm/st2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1577, in _get
    with open(path, 'rb') as stream:
IOError: [Errno 2] No such file or directory: '/opt/stackstorm/st2/lib/python2.7/site-packages/six-1.10.0.dist-info/METADATA'

However if i install directly from github it works just fine:

(st2) [root@stackstorm bin]# pip install -e git+https://github.com/StackStorm/st2sdk.git@master#egg=st2sdk
Obtaining st2sdk from git+https://github.com/StackStorm/st2sdk.git@master#egg=st2sdk
  Cloning https://github.com/StackStorm/st2sdk.git (to master) to /opt/stackstorm/st2/src/st2sdk
Requirement already satisfied: six==1.10.0 in /opt/stackstorm/st2/lib/python2.7/site-packages (from st2sdk)
Requirement already satisfied: cmd2<0.7,>=0.6.8 in /opt/stackstorm/st2/lib/python2.7/site-packages (from st2sdk)
Collecting jinja2<2.8,>=2.7.3 (from st2sdk)
Requirement already satisfied: pyparsing>=2.0.1 in /opt/stackstorm/st2/lib/python2.7/site-packages (from cmd2<0.7,>=0.6.8->st2sdk)
Requirement already satisfied: markupsafe in /opt/stackstorm/st2/lib/python2.7/site-packages (from jinja2<2.8,>=2.7.3->st2sdk)
Installing collected packages: jinja2, st2sdk
  Found existing installation: Jinja2 2.9.5
    Uninstalling Jinja2-2.9.5:
      Successfully uninstalled Jinja2-2.9.5
  Running setup.py develop for st2sdk
Successfully installed jinja2-2.7.3 st2sdk

System details:

(st2) [root@stackstorm bin]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)

(st2) [root@stackstorm bin]# uname -a
Linux stackstorm.maludy.home 3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

(st2) [root@stackstorm bin]# python --version
Python 2.7.5

(st2) [root@stackstorm bin]# st2 --version
st2 2.2.0

(st2) [root@stackstorm bin]# pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.                        
amqp (1.4.9)
anyjson (0.3.3)
appdirs (1.4.1)
APScheduler (3.3.0)
argcomplete (1.8.2)
Babel (2.3.4)
bcrypt (3.1.3)
beautifulsoup4 (4.5.3)
cffi (1.9.1)
cliff (2.4.0)
cmd2 (0.6.9)
contextlib2 (0.5.4)
cryptography (1.7.2)
debtcollector (1.11.0)
decorator (4.0.11)
entrypoints (0.3.0)
enum34 (1.1.6)
eventlet (0.18.4)
fasteners (0.14.1)
funcsigs (1.0.2)
functools32 (3.2.3.post2)
futures (3.0.5)
futurist (0.21.0)
gitdb2 (2.0.0)
GitPython (2.1.0)
greenlet (0.4.12)
gunicorn (19.6.0)
idna (2.2)
ipaddr (2.1.11)
ipaddress (1.0.18)
iso8601 (0.1.11)
Jinja2 (2.7.3)
jsonpath-rw (1.4.0)
jsonschema (2.5.1)
kazoo (2.2.1)
keystoneauth1 (2.18.0)
kombu (3.0.37)
lockfile (0.10.2)
logshipper (0.1.1.dev109)
logutils (0.3.4.1)
Mako (1.0.6)
MarkupSafe (0.23)
mongoengine (0.11.0)
monotonic (1.2)
msgpack-python (0.4.8)
ndg-httpsclient (0.4.2)
netaddr (0.7.19)
netifaces (0.10.5)
networkx (1.10)
os-client-config (1.26.0)
osc-lib (1.3.0)
oslo.config (1.12.1)
oslo.i18n (3.12.0)
oslo.serialization (2.16.0)
oslo.utils (3.0.0)
packaging (16.8)
paramiko (2.0.5)
passlib (1.6.5)
pbr (1.10.0)
pecan (0.7.0)
pika (0.10.0)
pip (9.0.1)
ply (3.10)
positional (1.1.1)
prettytable (0.7.2)
prompt-toolkit (1.0.7)
pyasn1 (0.2.2)
pycparser (2.17)
pycrypto (2.6.1)
pyinotify (0.9.6)
pymongo (3.4.0)
pyOpenSSL (16.2.0)
pyparsing (2.1.10)
python-dateutil (2.6.0)
python-editor (1.0.1)
python-gnupg (0.3.9)
python-json-logger (0.1.5)
python-keyczar (0.716)
python-keystoneclient (3.10.0)
python-mistralclient (2.2.0.dev382)
python-statsd (2.0.0)
pytz (2016.10)
PyYAML (3.12)
requests (2.11.1)
requestsexceptions (1.1.3)
retrying (1.3.3)
semver (2.7.2)
setuptools (34.2.0)
simplejson (3.10.0)
singledispatch (3.4.0.3)
six (1.10.0)
smmap2 (2.0.1)
sseclient (0.0.12)
st2 (2.2.0)
st2-auth-backend-flat-file (0.1.0)
st2-auth-backend-pam (0.1.0)
st2actions (2.2.0)
st2api (2.2.0)
st2auth (2.2.0)
st2client (2.2.0)
st2common (2.2.0)
st2debug (2.2.0)
st2exporter (2.2.0)
st2reactor (2.2.0)
st2sdk (0.3.0, /opt/stackstorm/st2/src/st2sdk)
st2stream (2.2.0)
stevedore (1.7.0)
tooz (1.20.0)
tzlocal (1.3)
unicodecsv (0.14.1)
virtualenv (15.1.0)
waitress (1.0.2)
wcwidth (0.1.7)
WebOb (1.7.1)
WebTest (2.0.25)
wheel (0.30.0a0)
wrapt (1.10.8)
zake (0.2.2)
brainstorm commented 6 years ago

+1 could someone please upload st2sdk 0.3.0 to pypi.org please?

iamlauriano commented 5 years ago

have you found a solution @nmaludy ?

iamlauriano commented 5 years ago

i found a solution on the my case, i use fedora 29, here is a solution https://fedora.pkgs.org/29/fedora-x86_64/python2-cmd2-0.8.8-5.fc29.noarch.rpm.html

Kami commented 5 years ago

@LaurianoElmiroDuarte What kind error do you get during installation?

Do keep in mind that it's almost never recommended to install it directly into your system Python environment using sudo pip install because it could conflict with other system dependencies.

You should pretty much always use a dedicated virtual environment for it (same goes for other Python projects).

So instead of sudo pip install st2sdk you should do something like:

virtualenv --no-site-packages ~/st2sdk.venv
~/st2sdk.venv/bin/pip install st2sdk
# And then use it like this
~/st2sdk.venv/bin/st2sdk --help
...

Or you are trying to install it directly into StackStorm virtual environment (/opt/stackstorm/st2)?

iamlauriano commented 5 years ago

Ohhh perfect @Kami very good ... but, this virtualenv its a virtual machine of python, his is will run just Python2,7 okay ? thnakful