horizon-research / Overcoming-NSP-Noise

A project aimed to overcome thermal noise generated by the heat of near sensor processing using a neural network trained on images with thermally-induced noise.
1 stars 0 forks source link

PySpin Re-Installation #11

Closed KodakC41 closed 2 years ago

KodakC41 commented 2 years ago

Major Issue

Used CSC_Independent % sudo python3.8 -m pip install --ignore-installed spinnaker_python-2.6.0.156-cp38-cp38-macosx_10_14_x86_64.whl

But now have error :

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so, 0x0002): Library not loaded: libSpinnaker.dylib.2.6.0.156
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/Lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so
  Reason: tried: 'libSpinnaker.dylib.2.6.0.156' (no such file), '/usr/lib/libSpinnaker.dylib.2.6.0.156' (no such file), '/Users/chris/PycharmProjects/CSC_Independent/libSpinnaker.dylib.2.6.0.156' (no such file), '/usr/lib/libSpinnaker.dylib.2.6.0.156' (no such file)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "HeatTrigger.py", line 25, in <module>
    import PySpin
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 17, in <module>
    _PySpin = swig_import_helper()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 16, in swig_import_helper
    return importlib.import_module('_PySpin')
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so, 0x0002): Library not loaded: libSpinnaker.dylib.2.6.0.156
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/Lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so
  Reason: tried: 'libSpinnaker.dylib.2.6.0.156' (no such file), '/usr/lib/libSpinnaker.dylib.2.6.0.156' (no such file), '/Users/chris/PycharmProjects/CSC_Independent/libSpinnaker.dylib.2.6.0.156' (no such file), '/usr/lib/libSpinnaker.dylib.2.6.0.156' (no such file)
KodakC41 commented 2 years ago

Not a clue

KodakC41 commented 2 years ago

The Wildest Part is this

chris@Chriss-MacBook-Pro-2 CSC_Independent % python3 HeatTrigger.py                                                                          
Traceback (most recent call last):
  File "HeatTrigger.py", line 24, in <module>
    import PySpin
ModuleNotFoundError: No module named 'PySpin'
chris@Chriss-MacBook-Pro-2 CSC_Independent % sudo -H  python3.8 -m pip install spinnaker_python-2.6.0.156-cp38-cp38-macosx_10_14_x86_64.whl  
Processing ./spinnaker_python-2.6.0.156-cp38-cp38-macosx_10_14_x86_64.whl
Requirement already satisfied: numpy>=1.15 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from spinnaker-python==2.6.0.156) (1.22.3)
Installing collected packages: spinnaker-python
Successfully installed spinnaker-python-2.6.0.156
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
KodakC41 commented 2 years ago

pip issues fixed, the issue remains that some files are not being added to the /usr/lib folder, not sure what to make of this, might be a MACOS update issue, I have tried copying the files in to the the folder, using a virtual environment, and writing the code on a different computer at this point. Maybe look up data augmentation styles.

KodakC41 commented 2 years ago

Code remains functional, it is just the package

KodakC41 commented 2 years ago

State of errors

(env) chris@Chriss-MacBook-Pro-2 CSC_Independent % python3 HeatTrigger.py     
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so, 0x0002): Library not loaded: libSpinnaker.dylib.2.5.0.80
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/Lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so
  Reason: tried: 'libSpinnaker.dylib.2.5.0.80' (no such file), '/usr/lib/libSpinnaker.dylib.2.5.0.80' (no such file), '/Users/chris/PycharmProjects/CSC_Independent/libSpinnaker.dylib.2.5.0.80' (no such file), '/usr/lib/libSpinnaker.dylib.2.5.0.80' (no such file)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "HeatTrigger.py", line 24, in <module>
    import PySpin
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 17, in <module>
    _PySpin = swig_import_helper()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PySpin.py", line 16, in swig_import_helper
    return importlib.import_module('_PySpin')
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so, 0x0002): Library not loaded: libSpinnaker.dylib.2.5.0.80
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/Lib/python3.8/site-packages/_PySpin.cpython-38-darwin.so
  Reason: tried: 'libSpinnaker.dylib.2.5.0.80' (no such file), '/usr/lib/libSpinnaker.dylib.2.5.0.80' (no such file), '/Users/chris/PycharmProjects/CSC_Independent/libSpinnaker.dylib.2.5.0.80' (no such file),
(env) chris@Chriss-MacBook-Pro-2 CSC_Independent % 
KodakC41 commented 2 years ago
try:
    import PySpin
    print(sys.path)
except:
   print("Module is not found, what in the world?\n\n")
   print(sys.path)
KodakC41 commented 2 years ago

Why PySpin takes a moment to recuperate, I have decided to use the Spinnaker_QT application, it is much easier to use and can be used to generate examples in the interim.

I believe this to be an OSX issue. This Link Proves that to be the case. The pathway, /usr/bin/Python has been completely removed, what this means it seems like use pckcheck according to this article could be helpful.

KodakC41 commented 2 years ago

Will use application Spinnaker_QT rather than use more time to reinstall the software.

KodakC41 commented 2 years ago

New week new error

The error seems to be another file error?

PySpin.SpinnakerException: Spinnaker: System instance cannot be acquired. Could not load producer. 

Make sure that the environment variable FLIR_GENTL64_CTI exists, and points to the location of the file FLIR_GenTL.cti [-1012]
KodakC41 commented 2 years ago

WE ARE IN BUSINESS!!!

KodakC41 commented 2 years ago

The fix was : csrutil disable in Recovery OS. Is this dangerous for system integrity? yes. But was it worth it? Also yes