I have been using AWS CLI on Ubuntu for a month. But today AWS CLI is throwing a python error, I haven't seen before:
sashank#sashank:~$ aws configure
Traceback (most recent call last):
File "/usr/local/bin/aws", line 27, in <module>
sys.exit(main())
File "/usr/local/bin/aws", line 23, in main
return awscli.clidriver.main()
File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 48, in main
return driver.main()
File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 173, in main
parser = self._create_parser()
File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 154, in _create_parser
command_table['help'] = self.create_help_command()
File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 149, in create_help_command
cli_data.get('help_usage', None))
File "/usr/local/lib/python2.7/dist-packages/awscli/help.py", line 259, in __init__
HelpCommand.__init__(self, session, session.provider,
AttributeError: 'Session' object has no attribute 'provider'
I have tried purging AWS CLI and removing all package files and re-installing, but error persists. Plz help!! Thanks.
Probably you have upgraded your virtualenv/setuptools and now your utility is screwed up. It happened to me with a wrongly set Chef that upgraded those two packages and, after that, the utility stopped working.
Related
I saved python script in single executable file with Pyinstaller, but when I tried to run it in console ./dist/myscript/myscript it raise AttributeError error with log below.
Log info
Traceback (most recent call last):
File "service.py", line 75, in <module>
File "service.py", line 31, in job
File "modelInstance.py", line 20, in __init__
File "prophet/forecaster.py", line 141, in __init__
File "prophet/forecaster.py", line 154, in _load_stan_backend
AttributeError: 'Prophet' object has no attribute 'stan_backend'
[1413] Failed to execute script 'service' due to unhandled exception!
As you see I'm using facebook's Prophet library to forecast time series data and all done in docker the container.
I have a weird error message using the download_and_convert_mnist_m.py script from github https://github.com/tensorflow/models/tree/master/research/domain_adaptation/datasets.
The command I am using from the models/research/ folder is
python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/
The error message is
Traceback (most recent call last):
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 237, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 233, in main
run(FLAGS.dataset_dir)
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 201, in run
os.path.join(dataset_dir, 'mnist_m', 'mnist_m_train'))
File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 177, in _get_filenames
for filename in os.listdir(dataset_dir):
OSError: [Errno 2] No such file or directory: '~/dsn_data/mnist_m/mnist_m_train'
I tried several ways:
without creating the path before and without having the data before
create the path before and let it empty
download and unpack data from https://drive.google.com/drive/folders/0B_tExHiYS-0vR2dNZEU4NGlSSW8 at the specified path as described here https://github.com/tensorflow/models/tree/master/research/domain_adaptation
I use
Ubuntu 16.04
Python 2.7
tensorflow 1.4.1
What else can I do.. looks like an pretty simple error but I have no more ideas.
I solved it. The correct command is without the equal sign.
python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/
I'm working on a python program which reads parquet type file and converts it in to pandas dataframe. It works fine while i use the python command to run it (python framework1.py arg1 arg2). But after converting it to an executable file using pyinstaller and when the executable file is ran , it gives the following error.
Traceback (most recent call last):
File "framework1.py", line 325, in <module>
File "filetype.py", line 24, in fileTypeSelector
File "pandas/io/parquet.py", line 256, in read_parquet
File "pandas/io/parquet.py", line 38, in get_engine
File "pandas/io/parquet.py", line 89, in __init__
File "distutils/version.py", line 296, in __cmp__
AttributeError: LooseVersion instance has no attribute 'version'
[17249] Failed to execute script framework1
Thanks in advance :)
I solved the issue by using fastparquet engine rather than using pyarrow.
df1=pd.read_parquet(filepath,engine='fastparquet')
I have no experience with python and I am installing a mongodb tools from https://github.com/rueckstiess/mtools. After installation and launch the application I got below exception errors. It seems that there is a grama issue but I am not sure about it. Is it caused by python version? I am using python 2.7. How can I know which version fix this problem?
# mlaunch init --single
Traceback (most recent call last):
File "/usr/local/bin/mlaunch", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/mtools/mlaunch/mlaunch.py", line 1438, in main
tool.run()
File "/usr/local/lib/python2.7/dist-packages/mtools/mlaunch/mlaunch.py", line 260, in run
getattr(self, self.args['command'])()
File "/usr/local/lib/python2.7/dist-packages/mtools/mlaunch/mlaunch.py", line 280, in init
current_version = self.getMongoDVersion()
File "/usr/local/lib/python2.7/dist-packages/mtools/mlaunch/mlaunch.py", line 475, in getMongoDVersion
if current_version.rindex('v') > 0:
ValueError: substring not found
I encounter the following error when freezing an app with esky. This occurs when using py2exe as the freezer module.
error: c:\docume~1\user\locals~1\temp\tmpkizl0t\scripts\my_script.py:
The process cannot access the file because it is being used by another process
The error only occurs when I use the sympy module in my code and add it to the packages in my setup.py file.
Here is the "options" part of my setup.py file:
options = {
'bdist_esky': {"freezer_module":"py2exe",
'includes':['encodings','Symbolic','matplotlib','Sequence','ClientTCP',
'XMLSequenceParser','XMLSequenceWriter','utils.widgets',
'pylab','ConfigParser','numpy','xml.etree.ElementTree','logging',
're','json','pylab','socket','struct','threading','traceback',
'utils.liststore','Reporter','tempfile', 'filecmp','os',
'cairo', 'pango', 'pangocairo', 'atk', 'gobject', 'gio','matplotlib.backends.backend_qt4agg','sympy'],
}
},
Problem below solved by answer from Thomas K:
If I use cx_freeze as the freezer module then the build completes but when I try to run the executable I get a similar error:
Traceback (most recent call last):
File "cx_Freeze__init__.py", line 743, in <module>
File "cx_Freeze__init__.py", line 332, in bootstrap
File "cx_Freeze__init__.py", line 359, in chainload
File "cx_Freeze__init__.py", line 729, in _chainload
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
exec code in m.__dict__
File "c:\docume~1\user\locals~1\temp\tmpyisdxd\scripts\my_script.py", line 1447,
in <module>
NameError: name '__file__' is not defined
Has anyone come across this problem?
The error seems to indicate that some other process is using one of the SymPy files. Maybe just restarting the computer will fix it?