OpenSSL version in the SONOS Self-Test Suite - sonos

I am trying to run the latest SONOS Self-Test Suite against a revised version of our API. I'm running macOS Sierra Version 10.12.4. The built-in (and remarkably difficult-to-remove) version of OpenSSL is 0.9.8zh.
I have been able to install OpenSSL 1.0.2k and override the path to be the default OpenSSL version, as shown by:
> openssl version
OpenSSL 1.0.2k 26 Jan 2017
> which openssl
/usr/local/opt/openssl/bin/openssl
Executing python suite_selftest.py returns the following:
Traceback (most recent call last):
File "suite_selftest.py", line 36, in <module>
import ssl_validation
File "/XXX/sonostest/smapi/content_workflow/ssl_validation.py", line 17, in <module>
from sslyze import sslyze
File "../../sonos_sslyze-1.1.0.dev_r293552-py2.7.egg/sslyze/sslyze.py", line 29, in <module>
File "../../sonos_sslyze-1.1.0.dev_r293552-py2.7.egg/sslyze/plugins/__init__.py", line 30, in <module>
File "../../sonos_sslyze-1.1.0.dev_r293552-py2.7.egg/sslyze/plugins/PluginCertInfo.py", line 32, in <module>
File "../../sonos_sslyze-1.1.0.dev_r293552-py2.7.egg/sslyze/utils/ctSSL/__init__.py", line 13, in <module>
File "../../sonos_sslyze-1.1.0.dev_r293552-py2.7.egg/sslyze/utils/ctSSL/load_openssl.py", line 99, in <module>
Is the Self-Test Suite directly using /usr/bin/openssl? Is there any way I can override or change the path it's using?

The self-test uses the open source SSLyze tool, and SSLyze loads the OpenSSL libraries (crypto and ssl library). When loading the libraries on OS X, the code looks first into the current directory and then calls Python's find_library(). Here is another stackoverflow about where Python searches for libraries:
Which paths does python ctypes module search for libraries on Mac OS?

Related

Could not find 'cudart64_100.dll' while trying to install tensorflow

I am trying to install tensorflow.
I have installed Cuda10.0 and cudnn, but I still get this error:
Traceback (most recent call last):
File "D:\python\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "D:\python\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Python_test/Python算法成品/机器学习/test/test.py", line 4, in <module>
import tensorflow as tf
File "D:\python\lib\site-packages\tensorflow\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "D:\python\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "D:\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "D:\python\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: `enter code here`https://developer.nvidia.com/cuda-90-download-archive
What am I missing or doing wrong?
To fix the issue, either: Install CUDA from September 2018, which comes with cudart64_100.dll and other 32 bit *100.dlls and 64 bit *100 libraries.
Or, if you want future support:
Install the latest NVIDIA GPU Computing Toolkit.
However, because the newest version of the CUDA library is cudart64_101.dll and TensorFlow 2.0 requires the older cudart64_100.dll, also install the CUDA from September 2018.
Then copy cudart64_100.dll library from the old install of CUDA to the new one.
Or just download the library from the file attached further below and copy it into your last CUDA installation directory in program files.
For more details please refer here

ImportError: liblapack.so.3gf: cannot open shared object file: No such file or directory

I have both python 2.7.16 and python 3.5.2 installed on my ubuntu 16.04 LTS and numpy used to work well on both of them but recently something went wrong with numpy on python 2 while it still running smoothly on python 3
I have tried to uninstall and install the numpy package and this did not fix anything
The exact stdout I am getting is as follow:
python -c "import numpy as np"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 50, in <module>
from .linalg import *
File "/home/ahmed/.local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: liblapack.so.3gf: cannot open shared object file: No such file or directory
Indeed Linux error while loading shared libraries: cannot open shared object file: No such file or directory resolved the problem. I had have only to do the following:
sudo find / -iname liblapack.so.3gf
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:*path_to_lib_as_found*
sudo ldconfig -v
Thanks to Abdur Rehman for the hint
Cheers.
Does your Ubuntu have the latest lapack library? Try installing sudo apt install liblapack3gf liblapack-dev. Sometimes you need to run sudo ldconfig after the install.

import tensorflow as tf gives errors even after installing without errors

I've been trying to solve this issue for long time. After many attempts in my existing python=3.5 env (in Anaconda), I deleted it and created a new env again just to properly install tensorflow with gpu support. To do that I did conda create -n FALL python=3.5 and then pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.11.0-cp35-cp35m-win_amd64.whl as suggested in tensorflow site, because I am on Windows 10 and have Anaconda. There was no error during installation. And I have been using Cuda 8.0 and cuDNN for my other deep learning practices without any hinders. So I could type python in my activated env. To check if tensorflow is installed accurately I did import tensorflow as tf and got
Traceback (most recent call last):
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\username\Anaconda3\envs\FALL\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\username\Anaconda3\envs\FALL\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\username\Anaconda3\envs\FALL\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\username\Anaconda3\envs\FALL\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\username\Anaconda3\envs\FALL\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
I would like someone could help me as possible.
Not sure if you are still looking for this question to be answered, but seeing as I just battled this very issue for the past few days, I figured I'd leave my two cents here in case it helps anyone moving forward.
As an initial note, I was not installing tensorflow through anaconda, but rather just via a pip install in a python virtualenv. I expect the solution to this issue would be similar using either anaconda or just pip.
It really just turned out in the end that I had one or more programs installed in incompatible versions for tensorflow.
As of my writing of this, tensorflow-gpu requires CUDA 9.0, CUPTI (should be included with the CUDA install), and cuDNN version greater than 7.2 (but note that this version should be compatible with your specific install of CUDA). My problem was that I was unwittingly using CUDA 10.0, which I think is theoretically compatible with tensorflow-gpu (based on cursory searches, it seems to work for some people), but didn't work for me at all.
Long story short, here is exactly the setup/process that worked for me:
CUDA compatible GPU (https://developer.nvidia.com/cuda-gpus to check yours specifically
python 3.5.4
tensorflow-gpu version 1.12.0
CUDA 9.0
CUPTI (again, this is included with your CUDA 9.0 install)
cuDNN 9.0 version 7.4.1.5. To install this correctly, make sure the .dll in /bin gets copied into the /bin folder of Cuda 9, the .h file from /include gets copied into the Cuda 9 /include folder, and the .lib file from /lib/x64 folder gets copied into the /lib/x64 folder for Cuda 9 (this all seems self evident, but oddly some installation guides I've seen only reference copying the .dll over).
visual c++ 2017
Microsoft Visual C++ 2015 Redistributable Update 3 (this can be found under 'Redistributables and Build Tools' here: https://visualstudio.microsoft.com/vs/older-downloads/). Do note that to install this I had to go into programs and settings and manually uninstall the visual c++ 2017 redistributable that was installed when I installed visual c++ to begin with.
Include both CUDA 9 and CUPTI in your path (CUDA (and cuDNN) for me was in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin, and CUPTI was in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64)
After all this importing tensorflow worked fine for me.
I honestly hope this helps someone out there, as this process was incredibly arduous for me personally and I'd love to be able to lessen that for someone else.

ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

I am trying to use tensorflow-gpu on my system. I have re-installed it many times, it gives the error give below. But when I use tensorflow-cpu it works fine. I have cuda 8.0 toolkit installed and cudnn 5.1.
Traceback (most recent call last):
File "finetune.py", line 17, in <module>
import tensorflow as tf
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/saurabh/code/env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
If changing your path variable does not work, running the following in your terminal is what usually solves this for me:
sudo ldconfig /usr/local/cuda/lib64
(sometimes cuda may need to be something like cuda-8.0, depending on your installation)
The problem is that you don't have environment variable CUDA_HOME set. If you think you have CUDA installed, then you need to make sure that the above environment variable is set prob=perly and contains address of the CUDA installation directory where all share libraries are located.
export CUDA_HOME=/CUDA/installation/path
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"
sudo ldconfig /usr/local/cuda/lib64
Works for me.
Please refer this link for more information.
https://github.com/tensorflow/tensorflow/issues/5343

Plone ldap add on installation issue

I am trying to get ldap authentication to work on Plone version 4.2. I have hammered at the issue for several hours without results. I have even tried these steps:
Install python-ldap 2.6 (C:\Python26)
Install Plone 4.2 with the installer (D:\Plone)
Edit buildout.cfg with plone.app.ldap in the EGG and ZCML section
Create a new folder called python_ldap-2.3.12-py2.6.egg in D:\Plone\buildout-cache\eggs\
Copy C:\Python26\lib\site-packages\python_ldap-2.3.12-py2.6.egg-info to D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\ and rename to EGG-INFO
Also copy the ldap folder in C:\Python26\lib\site-packages\ to D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\
Also copy the file ldapurl.py to C:\Python26\lib\site-packages\ to D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\
Next copy:
folder: C:\Python26\lib\site-packages\python_ldap-2.3.12-py2.6.egg-info
folder: C:\Python26\lib\site-packages\ldap
to D:\Plone\python\Lib\site-packages
Start commandbox and run bin\buildout
Start Plone, log in as admin and go to the extra products section. Here you will find the LDAP product. Install it and enter you LDAP details.
None of that really helped. When i try bin/buildout, I get the following message:
Installing instance.
Getting distribution for 'dataflake.fakeldap'.
zip_safe flag not set; analyzing archive contents...
Installed /tmp/easy_install-oISsVG/dataflake.fakeldap-1.0/setuptools_git-0.4.2-py2.6.egg
Got dataflake.fakeldap 1.0.
Generated script '/usr/local/Plone/zinstance/bin/instance'.
Installing zopepy.
Generated interpreter '/usr/local/Plone/zinstance/bin/zopepy'.
Installing zopeskel.
Generated script '/usr/local/Plone/zinstance/bin/zopeskel'.
Generated script '/usr/local/Plone/zinstance/bin/paster'.
Updating backup.
Updating chown.
chown: Running
echo Dummy references to force this to execute after referenced parts
echo /usr/local/Plone/zinstance/var/backups sudo -u plone
chmod 600 .installed.cfg
find /usr/local/Plone/zinstance/var -type d -exec chmod 700 {} \;
chmod 744 /usr/local/Plone/zinstance/bin/*
Dummy references to force this to execute after referenced parts
/usr/local/Plone/zinstance/var/backups sudo -u plone
Updating repozo.
Updating unifiedinstaller.
*************** PICKED VERSIONS ****************
[versions]
Products.LDAPMultiPlugins = 1.14
Products.LDAPUserFolder = 2.23
Products.PloneLDAP = 1.1
collective.sendaspdf = 2.6
dataflake.fakeldap = 1.0
jquery.pyproxy = 0.4.1
plone.app.ldap = 1.2.8
*************** /PICKED VERSIONS ***************
When I try bin/buildout, it says daemon process started and gives an id but when i try localhost:8080, it says "Problem loading page" and the page does not load. I tried bin/instance fg to display the errors and i following message.
bin/instance fg
2012-07-24 08:53:18 INFO ZServer HTTP server started at Tue Jul 24 08:53:18 2012
Hostname: 0.0.0.0
Port: 8080
2012-07-24 08:53:18 INFO Zope Set effective user to "plone"
2012-07-24 08:53:19 WARNING SecurityInfo Conflicting security declarations for "setText"
2012-07-24 08:53:19 WARNING SecurityInfo Class "ATTopic" had conflicting security declarations
2012-07-24 08:53:19 ERROR Application Could not import Products.LDAPMultiPlugins
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 606, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/__init__.py", line 22, in <module>
from Products.LDAPMultiPlugins.LDAPMultiPlugin import addLDAPMultiPluginForm
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/LDAPMultiPlugin.py", line 29, in <module>
from Products.LDAPUserFolder import manage_addLDAPUserFolder
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/__init__.py", line 20, in <module>
from Products.LDAPUserFolder.LDAPUserFolder import LDAPUserFolder
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPUserFolder.py", line 52, in <module>
from Products.LDAPUserFolder.LDAPDelegate import filter_format
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 19, in <module>
import ldap
File "/usr/local/Plone/buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/__init__.py", line 22, in <module>
from _ldap import *
ImportError: No module named _ldap
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/run.py", line 76, in <module>
run()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/run.py", line 22, in run
starter.prepare()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/__init__.py", line 86, in prepare
self.startZope()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/__init__.py", line 259, in startZope
Zope2.startup()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/__init__.py", line 47, in startup
_startup()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/App/startup.py", line 67, in startup
OFS.Application.import_products()
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 583, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 606, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/__init__.py", line 22, in <module>
from Products.LDAPMultiPlugins.LDAPMultiPlugin import addLDAPMultiPluginForm
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/LDAPMultiPlugin.py", line 29, in <module>
from Products.LDAPUserFolder import manage_addLDAPUserFolder
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/__init__.py", line 20, in <module>
from Products.LDAPUserFolder.LDAPUserFolder import LDAPUserFolder
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPUserFolder.py", line 52, in <module>
from Products.LDAPUserFolder.LDAPDelegate import filter_format
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 19, in <module>
import ldap
File "/usr/local/Plone/buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/__init__.py", line 22, in <module>
from _ldap import *
ImportError: No module named _ldap
What am i doing wrong? Help wil be deeply appreciated
Your buildout ran successfully, there were no problems there. Some of the packages you picked were not pinned, so your buildout reported what versions it choose for you.
Your server itself is not indeed running because the Python LDAP egg you installed seems to be incorrectly installed. The buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/_ldap.so library file is missing.
Remove the whole egg (rm -rf buildout-cache-eggs/python_ldap-2.3.12-py2.6.egg) make sure you have the OpenLDAP 2.x library and headers installed on your system (on Ubuntu and Debian the libldap2-dev should be enough). Then re-run buildout to reinstall the egg.
Alternatively, you could try and install the system python-ldap package (remove the egg) and see if buildout picks that up instead.
You need to install 2 libs:
sudo apt-get install libldap2-dev
sudo apt-get install libsasl2-dev
Hope that will help.