i am a beginner in python trying to use playsound module ,when run program ,it shows The specified device is not open or is not recognized by MCI - playsound

Traceback (most recent call last):
File "c:\Users\masai\Documents\programming languages\sound.py", line 4, in
playsound('//C://Users//masai//Downloads//03. Arambh (online-audio-converter.com)')
File "C:\Users\masai\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 35, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
File "C:\Users\masai\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 31, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 263 for command:
open "//C://Users//masai//Downloads//03. Arambh (online-audio-converter.com)" alias playsound_0.4501127239858208
The specified device is not open or is not recognized by MCI.

Related

Seems Ansible failed to get the temp files

Ansible failed while running the tasks and referring file/folder not exists in the ansible temp folder of a target machine. It has been working fine and not sure why all of sudden it stopped working
changed : false
module_stderr : Shared connection to 10.131.132.11 closed.\r\n
module_stdout : Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1662460628.845051-105063944436404/AnsiballZ_setup.py\", line 113, in <module>\r\n try:\r\n File \"/root/.ansible/tmp/ansible-tmp-1662460628.845051-105063944436404/AnsiballZ_setup.py\", line 98, in _ansiballz_main\r\n json_params = f.read()\r\n File \"/usr/lib64/python2.7/tempfile.py\", line 321, in mkdtemp\r\n dir = gettempdir()\r\n File \"/usr/lib64/python2.7/tempfile.py\", line 265, in gettempdir\r\n tempdir = _get_default_tempdir()\r\n File \"/usr/lib64/python2.7/tempfile.py\", line 212, in _get_default_tempdir\r\n (\"No usable temporary directory found in %s\" % dirlist))\r\nIOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/root']\r\n
msg : MODULE FAILURE\nSee stdout/stderr for the exact error
rc : 1
You can start by checking the permissions if they changed.
I think the disk is probably full. I had the same issue and it was the case.
You can type df -h
Also you can verify the inode.
You can type df -i

Volttron on MacOS issue with vcfg

Running into the issue below while trying to run vcfg command in Volttron on my Mac use iTerm. Any help would be much appreciated.
'''
(volttron)cg#Carolyns-MacBook-Pro volttron % vcfg
Your VOLTTRON_HOME currently set to: /Users/cg/.volttron
Is this the volttron you are attempting to setup? [Y]:
Message bus set to zmq
What is the vip address? [tcp://127.0.0.1]:
What is the port for the vip address? [22916]:
Is this instance web enabled? [N]: Y
Traceback (most recent call last):
File "/Users/cg/volttron/env/bin/vcfg", line 11, in <module>
load_entry_point('volttron', 'console_scripts', 'vcfg')()
File "/Users/cg/volttron/volttron/platform/config.py", line 593, in _main
main()
File "/Users/cg/volttron/volttron/platform/instance_setup.py", line 862, in main
wizard()
File "/Users/cg/volttron/volttron/platform/instance_setup.py", line 748, in wizard
do_web_enabled_zmq(volttron_home)
File "/Users/cg/volttron/volttron/platform/instance_setup.py", line 433, in do_web_enabled_zmq
'https://' + get_hostname())
File "/Users/cg/volttron/volttron/utils/__init__.py", line 27, in get_hostname
with open('/etc/hostname') as fp:
IOError: [Errno 2] No such file or directory: '/etc/hostname'
'''
/etc/hostname does not exist on Mac. The documentation for Volttron indicates that it only supports Linux operating systems.. It seems like you'll have to use a Linux host (or use virtualization).

`ansible --version` command throws an ERROR

Good Day guys
I have installed ansible on my mac, it was successfully installed but then when I run the command ansible --version it throws me a n error:
Unhandled error:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/ansible/config/manager.py", line 559, in update_config_data
value, origin = self.get_config_value_and_origin(config, configfile)
File "/Library/Python/2.7/site-packages/ansible/config/manager.py", line 503, in get_config_value_and_origin
value = ensure_type(value, defs[config].get('type'), origin=origin)
File "/Library/Python/2.7/site-packages/ansible/config/manager.py", line 124, in ensure_type
value = tempfile.mkdtemp(prefix=prefix, dir=value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 339, in mkdtemp
_os.mkdir(file, 0700)
OSError: [Errno 13] Permission denied: '/Users/patrick/.ansible/tmp/ansible-local-37505vvsQNX'
Traceback (most recent call last):
File "/usr/local/bin/ansible", line 62, in <module>
import ansible.constants as C
File "/Library/Python/2.7/site-packages/ansible/constants.py", line 174, in <module>
config = ConfigManager()
File "/Library/Python/2.7/site-packages/ansible/config/manager.py", line 291, in __init__
self.update_config_data()
File "/Library/Python/2.7/site-packages/ansible/config/manager.py", line 571, in update_config_data
raise AnsibleError("Invalid settings supplied for %s: %s\n" % (config, to_native(e)), orig_exc=e)
ansible.errors.AnsibleError: Invalid settings supplied for DEFAULT_LOCAL_TMP: [Errno 13] Permission denied: '/Users/patrick/.ansible/tmp/ansible-local-37505vvsQNX'
Appreciate your help guys.
Check if this is similar to iiab/iiab/issue 1212:
After some more digging, I found the real source of this problem was hardcoded paths in ansible.cfg
Or the more recent ansible/galaxy-dev issue 107, which leads to PR 110:
The default ansible temp dir ~/.ansible/tmp is accessed by ansible-doc via the galaxy-importer.
This works OK in the galaxy-dev local env, but on the CI environment it attempts to create dir /.ansible/tmp and fails.
This PR changes the default ansible temp dir to /tmp/ansible which is outside the user home (and in the local env, /tmp has greater permissions)
Try and change DEFAULT_LOCAL_TMP to /tmp.
~/.ansible/tmp is probably root, so not accessible. chown it to user
I have disabled 'gathering' in ansible.cfg to fix the issue.
# gathering = False
Below error occurring before commenting this.
~ % ansible
Unhandled error:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/ansible/6.6.0/libexec/lib/python3.10/site-packages/ansible/config/manager.py", line 627, in update_config_data
value, origin = self.get_config_value_and_origin(config, configfile)
File "/opt/homebrew/Cellar/ansible/6.6.0/libexec/lib/python3.10/site-packages/ansible/config/manager.py", line 586, in get_config_value_and_origin
raise AnsibleOptionsError('Invalid value "%s" for configuration option "%s", valid values are: %s' %
ansible.errors.AnsibleOptionsError: Invalid value "False" for configuration option "setting: DEFAULT_GATHERING ", valid values are: implicit, explicit, smart

Golang: Preview of managed VM app returns error

I'm trying to preview a Go docker (App Engine ManagedVM) app using the gcloud preview app run command.
But I keep getting this error:
Traceback (most recent call last):
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 985, in <module>
main()
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 978, in main
dev_server.start(options)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 774, in start
self._dispatcher.start(options.api_host, apis.port, request_data)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 182, in start
_module, port = self._create_module(module_configuration, port)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 262, in _create_module
threadsafe_override=threadsafe_override)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1463, in __init__
super(ManualScalingModule, self).__init__(**kwargs)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 514, in __init__
self._module_configuration)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 237, in _create_instance_factory
module_configuration=module_configuration)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_factory.py", line 78, in __init__
timeout=self.DOCKER_D_REQUEST_TIMEOUT_SECS)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 740, in NewDockerClient
client.ping()
File "/Users/jwesonga/google-cloud-sdk/./lib/docker/docker/client.py", line 711, in ping
return self._result(self._get(self._url('/_ping')))
File "/Users/jwesonga/google-cloud-sdk/./lib/docker/docker/client.py", line 76, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/lib/requests/requests/sessions.py", line 468, in get
return self.request('GET', url, **kwargs)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/lib/requests/requests/sessions.py", line 456, in request
resp = self.send(prep, **send_kwargs)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/lib/requests/requests/sessions.py", line 559, in send
r = adapter.send(request, **kwargs)
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine/lib/requests/requests/adapters.py", line 384, in send
raise Timeout(e, request=request)
requests.exceptions.Timeout: (<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10631c7d0>, 'Connection to 192.168.59.104 timed out. (connect timeout=60)')
ERROR: (gcloud.preview.app.run) DevAppSever failed with error code [1]
I've confirmed that docker is up and running using boot2docker status which returns running This was working before but after a machine reboot, nothing seems to work. Any ideas?
The main issue is:
File "/Users/jwesonga/google-cloud-sdk/platform/google_appengine
/lib/requests/requests/adapters.py", line 384, in send
raise Timeout(e, request=request)
requests.exceptions.Timeout:
(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object
at 0x10631c7d0>, 'Connection to 192.168.59.104 timed out.
(connect timeout=60)')
ERROR: (gcloud.preview.app.run) DevAppSever failed with error code [1]
Which is often the case when you have a proxy, and is discussed in pip issue 1805
It is supposed to be fixed in pip1.6, but just in case, you can try the workaround of alexandrem
/opt/venvs/ironic/lib/python2.6/site-packages/pip/_vendor/requests
/adapters.patch.py /opt/venvs/ironic/lib/python2.6/site-packages
/pip/_vendor/requests/adapters.py
209c209
if True or not proxy in self.proxy_manager:
^^^^
basically I just add a True to the condition on line 209 of the adapter.py to always create a ProxyManager instance, thus skipping the pool manager logic.
The gcloud command enable the ah_host process and also created the docker image of your app and passes it to the Docker daemon, in your case it seems that your docker daemon is not responding to the request. So to make sure,perform "sudo docker -d" to check if the Docker daemon is running on your machine or not.
Also check that, the path of the certificate you set correctly and value of the TLS_VERIFY is TRUE.
Go through the documentation [1] for the installation of Docker on MacOS
[1] https://docs.docker.com/installation/mac/

Python 3.4 and Windows Shared File Paths

I am trying to open a file in a shared network location
open('\\int\GroupData\ITProSup\Operations Support\REMGROUP.txt','+r')
Now this turns into
nemonics>python main.py
eback (most recent call last):
le "main.py", line 41, in <module>
sys.exit(main())
le "main.py", line 36, in main
insert_file_into_db(con_S104838,open('\\int\GroupData\ITProSup\Operations Su
t\REMGROUP.txt','+r'))
NotFoundError: [Errno 2] No such file or directory: '\\int\\GroupData\\ITPro
\Operations Support\\REMGROUP.txt'
I have tried this thread Using Python, how can I access a shared folder on windows network? but it does note seem to work for me. I am running python 3.4.1 and its windows 2012 server.
I have also tried using os.path https://docs.python.org/3.4/library/os.path.html#os.path.normpath with not much luck
C:\mnemonics>python main.py
Traceback (most recent call last):
File "main.py", line 41, in <module>
sys.exit(main())
File "main.py", line 36, in main
insert_file_into_db(con_S104838, open(os.path.normpath('\\int\GroupData\ITPr
oSup\Operations Support\REMGROUP.txt')))
FileNotFoundError: [Errno 2] No such file or directory: '\\int\\GroupData\\ITPro
Sup\\Operations Support\\REMGROUP.txt'
C:\mnemonics>python main.py
Traceback (most recent call last):
File "main.py", line 42, in <module>
sys.exit(main())
File "main.py", line 37, in main
open(os.path.normcase('\\int\GroupData\ITProSup\Operations Support\REMGROUP.
txt'),'+r'))
FileNotFoundError: [Errno 2] No such file or directory: '\\int\\groupdata\\itpro
sup\\operations support\\remgroup.txt'
Any help would be greatly appreciated
Note that \ should be escaped to \\, so \\ should be \\\\
Please try
'\\\\int\\GroupData\\ITProSup\\Operations Support\\REMGROUP.txt'
or
'//int/GroupData/ITProSup/Operations Support/REMGROUP.txt'

Resources