Problem: I am trying to run a shell script which contains python script from Debian Linux env which is running properly but when I am calling it via crontab it is giving me an error below.
error
Traceback (most recent call last):
File "/home/samsunguk/env/lib/python3.5/site-packages/oauth2client/clientsecrets.py", line 121, in _loadfile
with open(filename, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: './client_secrets.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/samsunguk/env/lib/python3.5/site-packages/pydrive/auth.py", line 386, in LoadClientConfigFile
client_type, client_info = clientsecrets.loadfile(client_config_file)
File "/home/samsunguk/env/lib/python3.5/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/home/samsunguk/env/lib/python3.5/site-packages/oauth2client/clientsecrets.py", line 125, in _loadfile
exc.strerror, exc.errno)
oauth2client.clientsecrets.InvalidClientSecretsError: ('Error opening file', './client_secrets.json', 'No such file or directory', 2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/samsunguk/segmentTrendsandTraits/segmentTrend.py", line 193, in <module>
extract_data(60, "csv_output_all_data_segments_BAAAM.csv", "output_data_segments_Last60days.csv", "output_data_segments_Last60days.xlsx")
File "/home/samsunguk/segmentTrendsandTraits/segmentTrend.py", line 185, in extract_data
gauth.LocalWebserverAuth()
File "/home/samsunguk/env/lib/python3.5/site-packages/pydrive/auth.py", line 113, in _decorated
self.GetFlow()
File "/home/samsunguk/env/lib/python3.5/site-packages/pydrive/auth.py", line 443, in GetFlow
self.LoadClientConfig()
File "/home/samsunguk/env/lib/python3.5/site-packages/pydrive/auth.py", line 366, in LoadClientConfig
self.LoadClientConfigFile()
File "/home/samsunguk/env/lib/python3.5/site-packages/pydrive/auth.py", line 388, in LoadClientConfigFile
raise InvalidConfigError('Invalid client secrets file %s' % error)
pydrive.settings.InvalidConfigError: Invalid client secrets file ('Error opening file', './client_secrets.json', 'No such file or directory', 2)
My python script has google authorization credentials.
Can anyone help me why I am getting this error?
I just updated pip and some packages and now I get the following error when running just about any command like show or list (-V works):
Exception:
Traceback (most recent call last):
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2897, in _dep_map
return self.__dep_map
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2888, in _parsed_pkg_info
return self._pkg_info
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _pkg_info
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 176, in main
status = self.run(options, args)
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 47, in run
results, list_files=options.files, verbose=options.verbose):
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 137, in print_results
pkg.project_name for pkg in pkg_resources.working_set
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 138, in <listcomp>
if name in [required.name for required in pkg.requires()]
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2635, in requires
dm = self._dep_map
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2899, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2908, in _compute_dependencies
for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2890, in _parsed_pkg_info
metadata = self.get_metadata(self.PKG_INFO)
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1410, in get_metadata
value = self._get(self._fn(self.egg_info, name))
File "/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1522, in _get
with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/-ytz-2018.5.dist-info/METADATA'
Is this just my configuration or is there a known bug, etc?
Any ideas on how to fix it? - I can't say I've ever had this problem before
I've been trying to compile numpy from source using Intel MKL and the Intel C/C++ compilers. I have a student license which gives me access to these compilers/MKL. It appears that I built numpy but when I run numpy.test('full') I get these errors:
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1565, in close
fp.close()
OSError: [Errno 28] No space left on device
EException ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba36cd02e8>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1560, in close
self.fp.flush()
OSError: [Errno 28] No space left on device
/usr/lib/python3.4/unittest/case.py:605: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/tmpgl9796ik.npz'>
outcome.errors.clear()
EException ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba3727f550>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1565, in close
fp.close()
OSError: [Errno 28] No space left on device
EEException ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba329a76a0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1468, in close
pos1 = self.fp.tell()
File "/usr/lib/python3.4/tempfile.py", line 399, in func_wrapper
return func(*args, **kwargs)
ValueError: I/O operation on closed file
EEEException ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba329a78d0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1468, in close
pos1 = self.fp.tell()
ValueError: I/O operation on closed file
EF....E.EEException ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba329a7fd0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1565, in close
fp.close()
OSError: [Errno 28] No space left on device
Exception ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba329a73c8>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1565, in close
fp.close()
OSError: [Errno 28] No space left on device
Exception ignored in: <bound method ZipFile.__del__ of <zipfile.ZipFile object at 0x7fba329a7da0>>
Traceback (most recent call last):
File "/usr/lib/python3.4/zipfile.py", line 1457, in __del__
self.close()
File "/usr/lib/python3.4/zipfile.py", line 1565, in close
fp.close()
OSError: [Errno 28] No space left on device
warnings.warn("Warning: converting a masked element to nan.")
======================================================================
ERROR: test_big_arrays (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/testing/decorators.py", line 146, in skipper_func
return f(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 199, in test_big_arrays
np.savez(tmp, a=a)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: 2147583648 requested and 2021494704 written
======================================================================
ERROR: test_closing_fid (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 282, in test_closing_fid
np.savez(fp, data='LOVELY LOAD')
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_closing_zipfile_after_load (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 309, in test_closing_zipfile_after_load
np.savez(tmp, lab='place holder')
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_format_2_0 (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 538, in write_array
version)
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 319, in _write_array_header
fp.write(header)
OSError: [Errno 28] No space left on device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 166, in test_format_2_0
self.check_roundtrips(a)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 111, in check_roundtrips
self.roundtrip(a)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 179, in roundtrip
RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 92, in roundtrip
save_func(target_file, *arr, **save_kwds)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_mmap (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 92, in roundtrip
save_func(target_file, *arr, **save_kwds)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/testing/decorators.py", line 215, in knownfailer
return f(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 152, in test_mmap
self.roundtrip(a, file_on_disk=True, load_kwds={'mmap_mode': 'r'})
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 179, in roundtrip
RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 107, in roundtrip
if not isinstance(arr_reloaded, np.lib.npyio.NpzFile):
UnboundLocalError: local variable 'arr_reloaded' referenced before assignment
======================================================================
ERROR: test_multiple_arrays (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 208, in test_multiple_arrays
self.roundtrip(a, b)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 179, in roundtrip
RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 92, in roundtrip
save_func(target_file, *arr, **save_kwds)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_named_arrays (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 214, in test_named_arrays
np.savez(c, file_a=a, file_b=b)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_not_closing_opened_fid (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 255, in test_not_closing_opened_fid
np.savez(fp, data='LOVELY LOAD')
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_record (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 159, in test_record
self.check_roundtrips(a)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 111, in check_roundtrips
self.roundtrip(a)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 179, in roundtrip
RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 92, in roundtrip
save_func(target_file, *arr, **save_kwds)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_io.test_gzip_loadtxt
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 1684, in test_gzip_loadtxt
os.write(f, s.read())
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_io.test_npzfile_dict
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 1708, in test_npzfile_dict
np.savez(s, x=x, y=y)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_io.test_load_refcount
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 597, in _savez
format.write_array(fid, np.asanyarray(val))
File "/usr/lib/python3.4/site-packages/numpy/lib/format.py", line 562, in write_array
array.tofile(fp)
OSError: first argument must be a string or open file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 1735, in test_load_refcount
np.savez(f, [1, 2, 3])
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 534, in savez
_savez(file, args, kwds, False)
File "/usr/lib/python3.4/site-packages/numpy/lib/npyio.py", line 603, in _savez
fid.close()
OSError: [Errno 28] No space left on device
======================================================================
ERROR: test_fromtextfile (test_mrecords.TestMRecordsImport)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/ma/tests/test_mrecords.py", line 489, in test_fromtextfile
os.write(tmp_fd, fcontent)
OSError: [Errno 28] No space left on device
======================================================================
FAIL: test_savez_filename_clashes (test_io.TestSavezLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/numpy/lib/tests/test_io.py", line 245, in test_savez_filename_clashes
raise AssertionError(errors)
AssertionError: [OSError(28, 'No space left on device'), OSError(28, 'No space left on device'), OSError(28, 'No space left on device')]
----------------------------------------------------------------------
Ran 5762 tests in 122.291s
FAILED (KNOWNFAIL=6, SKIP=17, errors=13, failures=1)
Any idea what's going on or where it might be going wrong?