issue while installing sdk
File "setup.py", line 135 with closing(tarfile.open(os.path.join("build", app + ".spl"), "w")) as spl: ^ SyntaxError: invalid syntax
kinldy help
What version of Python are you using?
I am doing testing where splunk 6.1 is installed so python comes with splunk is 2.7.5
Can you share your full command line invocation?
$SPLUNK_HOME/bin/python --version this shows 2.7.5 for installing i am using this command python setup.py install and in .bash_profile we have given the path like PYTHONPATH=/home/splunk/ET_Deployment/splunk-sdk-python
So if you do:
$SPLUNK_HOME/bin/splunk cmd python setup.py install
Do you still get the error?
For reference, the error you're getting is that Python is not recognizing the with statement. That was added in Python 2.5, which is what is leading me to believe this is a Python version issue.
[splunk@nllipidcn37110 splunk-sdk-python]$ $SPLUNK_HOME/bin/splunk cmd python setup.py install usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help
error: invalid command 'install'
If you do:
$SPLUNK_HOME/bin/splunk cmd python setup.py --help
what do you get?
Common commands: (see '--help-commands' for more)
setup.py build will build the package underneath 'build/' setup.py install will install the package
Global options: --verbose (-v) run verbosely (default) --quiet (-q) run quietly (turns verbosity off) --dry-run (-n) don't actually do anything --help (-h) show detailed help message --no-user-cfg ignore pydistutils.cfg in your home directory --command-packages list of packages that provide distutils commands
Information display options (just display information, ignore any commands)
--help-commands list all available commands
--name print package name
--version (-V) print package version
--fullname print
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help
Hi @splunk47 sorry about the delay on this. I was able to help someone with this a couple of weeks ago.
If you want to install from the pypi remote servers:
sudo pip install --ignore-installed --target="$SPLUNK_HOME/lib/python2.7/site-packages" splunk-sdk
If you want to install from a local directory (ie: after a git clone):
sudo pip install --ignore-installed --target="$SPLUNK_HOME/lib/python2.7/site-packages" /an/absolute/path/to/splunk-sdk-python