opencybersecurityalliance / stix-shifter

This project consists of an open source library allowing software to connect to data repositories using STIX Patterning, and return results as STIX Observations.
https://stix-shifter.readthedocs.io
Other
229 stars 233 forks source link

Can't install package - Mac OSX #36

Closed packet-rat closed 6 years ago

packet-rat commented 6 years ago

Cloned repo, executed sudo python3 setup.py build, and then tried sudo python3 setup.py install

$ sudo python3 setup.py install

<SNIP>
copying build/lib/stix_shifter/src/modules/base/base_result_translator.py -> build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/base
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/test_web_api.py to test_web_api.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/generate_test_case.py to generate_test_case.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/test_miscellaneous_tests.py to test_miscellaneous_tests.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/test_analytic_translator.py to test_analytic_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/integration_tests.py to integration_tests.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/helpers/connectors.py to connectors.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/patterns/helpers/input_file_helpers.py to input_file_helpers.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/qradar_stix_to_aql/test_class.py to test_class.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/qradar_stix_to_aql/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/qradar_json_to_stix/test_class.py to test_class.cpython-35.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/tests/qradar_json_to_stix/test_class.py", line 88
    assert(ip_ref in objects), f"dst_ref with key {nt_object['dst_ref']} not found"
                                                                                  ^
SyntaxError: invalid syntax

byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/qradar_json_to_stix/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/car_json_to_stix/test_class.py to test_class.cpython-35.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/tests/car_json_to_stix/test_class.py", line 100
    assert(binary_ref in objects), f"binary_ref with key {binary_ref} not found"
                                                                               ^
SyntaxError: invalid syntax

byte-compiling build/bdist.macosx-10.9-x86_64/egg/tests/car_json_to_stix/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/stix_shifter.py to stix_shifter.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/grammar/STIXPatternVisitor.py to STIXPatternVisitor.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/grammar/STIXPatternListener.py to STIXPatternListener.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/grammar/STIXPatternLexer.py to STIXPatternLexer.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/grammar/STIXPatternParser.py to STIXPatternParser.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/grammar/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/parser.py to parser.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/pattern_objects.py to pattern_objects.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/errors.py to errors.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/patterns/translator.py to translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/transformers.py to transformers.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/json_to_stix/json_to_stix.py to json_to_stix.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/json_to_stix/observable.py to observable.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/json_to_stix/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/json_to_stix/json_to_stix_translator.py to json_to_stix_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/exceptions.py to exceptions.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/car/car_data_mapping.py to car_data_mapping.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/car/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/car/car_translator.py to car_translator.cpython-35.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/car/car_translator.py", line 27
    obj[f"{typ}.{field}"] = fields[field]
                       ^
SyntaxError: invalid syntax

byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/dummy/dummy_translator.py to dummy_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/dummy/dummy_query_translator.py to dummy_query_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/dummy/dummy_result_translator.py to dummy_result_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/elastic/elastic_query_constructor.py to elastic_query_constructor.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/elastic/elastic_translator.py to elastic_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/elastic/stix_to_elastic.py to stix_to_elastic.cpython-35.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/elastic/stix_to_elastic.py", line 35
    raise NotImplementedError(f"Module {data_mapper_module_name} not implemented")
                                                                                ^
SyntaxError: invalid syntax

byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/cim/cim_data_mapping.py to cim_data_mapping.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/qradar/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/qradar/qradar_data_mapping.py to qradar_data_mapping.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/qradar/aql_query_constructor.py to aql_query_constructor.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/qradar/stix_to_aql.py to stix_to_aql.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/qradar/qradar_translator.py to qradar_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/stix_to_splunk.py to stix_to_splunk.cpython-35.pyc
  File "build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/stix_to_splunk.py", line 35
    raise NotImplementedError(f"Module {data_mapper_module_name} not implemented")
                                                                                ^
SyntaxError: invalid syntax

byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/splunk_query_constructor.py to splunk_query_constructor.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/encoders.py to encoders.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/object_scopers.py to object_scopers.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/splunk/splunk_translator.py to splunk_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/base/base_translator.py to base_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/base/base_query_translator.py to base_query_translator.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/base/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/stix_shifter/src/modules/base/base_result_translator.py to base_result_translator.cpython-35.pyc
creating build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying stix_shifter.egg-info/PKG-INFO -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying stix_shifter.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying stix_shifter.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying stix_shifter.egg-info/requires.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying stix_shifter.egg-info/top_level.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
stix_shifter.src.modules.qradar.__pycache__.qradar_data_mapping.cpython-35: module references __file__
stix_shifter.src.modules.qradar.__pycache__.qradar_translator.cpython-35: module references __file__
tests.patterns.__pycache__.generate_test_case.cpython-35: module references __file__
tests.patterns.__pycache__.test_web_api.cpython-35: module references __file__
tests.patterns.helpers.__pycache__.input_file_helpers.cpython-35: module references __file__
creating 'dist/stix_shifter-1.0.0-py3.5.egg' and adding 'build/bdist.macosx-10.9-x86_64/egg' to it
removing 'build/bdist.macosx-10.9-x86_64/egg' (and everything under it)
Processing stix_shifter-1.0.0-py3.5.egg
removing '/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg' (and everything under it)
creating /Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg
Extracting stix_shifter-1.0.0-py3.5.egg to /Users/pmaroney/anaconda3/lib/python3.5/site-packages
  File "/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg/stix_shifter/src/modules/car/car_translator.py", line 27
    obj[f"{typ}.{field}"] = fields[field]
                       ^
SyntaxError: invalid syntax

  File "/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg/stix_shifter/src/modules/elastic/stix_to_elastic.py", line 35
    raise NotImplementedError(f"Module {data_mapper_module_name} not implemented")
                                                                                ^
SyntaxError: invalid syntax

  File "/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg/stix_shifter/src/modules/splunk/stix_to_splunk.py", line 35
    raise NotImplementedError(f"Module {data_mapper_module_name} not implemented")
                                                                                ^
SyntaxError: invalid syntax

  File "/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg/tests/car_json_to_stix/test_class.py", line 100
    assert(binary_ref in objects), f"binary_ref with key {binary_ref} not found"
                                                                               ^
SyntaxError: invalid syntax

  File "/Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg/tests/qradar_json_to_stix/test_class.py", line 88
    assert(ip_ref in objects), f"dst_ref with key {nt_object['dst_ref']} not found"
                                                                                  ^
SyntaxError: invalid syntax

stix-shifter 1.0.0 is already the active version in easy-install.pth

Installed /Users/pmaroney/anaconda3/lib/python3.5/site-packages/stix_shifter-1.0.0-py3.5.egg
Processing dependencies for stix-shifter==1.0.0
Searching for stix2-validator==1.0.1
Reading https://pypi.python.org/simple/stix2-validator/
No local packages or working download links found for stix2-validator==1.0.1
error: Could not find suitable distribution for Requirement.parse('stix2-validator==1.0.1')
JasonKeirstead commented 6 years ago

It appears from the stack trace that you are using Python 3.5, can you confirm?

The package currently requires Python 3.6 and above

packet-rat commented 6 years ago

Sorry. I wasn't paying close attention to the outcome of my attempt to upgrade that environment to python3.6:

(Utopia)MAC-PB-01:stix-shifter pmaroney$ conda install python=3.6
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - futures -> python=3.4
  - python=3.6
Use "conda info <package>" to see the dependencies for each package.

Ultimately the following did the trick:

conda create --name py365 python=3.6.5 --channel conda-forge
source activate py365