After an upgrade on my awscli install, I ran in this error. I can't figure out the reason for that error. Can anyone help?
AWS Cli Error:
Traceback (most recent call last):
File "/usr/bin/aws", line 23, in <module>
sys.exit(main())
File "/usr/bin/aws", line 19, in main
return awscli.clidriver.main()
File "/usr/share/awscli/awscli/clidriver.py", line 44, in main
driver = create_clidriver()
File "/usr/share/awscli/awscli/clidriver.py", line 53, in create_clidriver
event_hooks=emitter)
File "/usr/share/awscli/awscli/plugin.py", line 44, in load_plugins
modules = _import_plugins(plugin_mapping)
File "/usr/share/awscli/awscli/plugin.py", line 61, in _import_plugins
module = __import__(path, fromlist=[module])
File "/usr/share/awscli/awscli/handlers.py", line 24, in <module>
from awscli.customizations.ec2addcount import ec2_add_count
File "/usr/share/awscli/awscli/customizations/ec2addcount.py", line 16, in <module>
from botocore.parameters import StringParameter
ImportError: No module named 'botocore.parameters'
Any help will be apreciated!
Best regards
The subpackage botocore.parameters was split into serveral other modules with version 0.64.0 - but your version of awscli seems to rely on an older version as it expects this package to be present.
Depending on your way of installing awscli the problem might have different origins. When looking at the paths in the trace, it seems as if you've installed it with a package from your OS vendor. Instead of doing that you might drop those package and install it using pip.
pip install awscli
This will ensure the currently latest stable version of awscli to be installed. When you want to upgrade again in the future, run pip -U install awscli.
If you want to stick with the OS vendors version you probably want to reinstall awscli completely to fix this issue.
Another easier solution would be to use the awscli install bundle provided by amazon.
You can find all the instructions here:
https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html
Related
When I run dev_appserver.py on google-cloud-sdk, I get ImportError: No module named py27_urlquote.
Traceback (most recent call last):
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 109, in <module>
_run_file(__file__, globals())
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in _run_file
_execfile(_PATHS.script_file(script_name), globals_)
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in _execfile
execfile(fn, scope)
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 44, in <module>
from google.appengine.tools.devappserver2 import dispatcher
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 43, in <module>
from google.appengine.tools.devappserver2 import module
File "/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 39, in <module>
import py27_urlquote
ImportError: No module named py27_urlquote
I have tried the following:
Reinstall Cloud SDK
Find out about the py27_urlquote module (I couldn't find any such information ...)
Change the version of CLOUDSDK_PYTHON to 2.7 or 3.8 and execute
Right now this is a public issue and is currently being addressed by our Google Engineering Team. A workaround was provided for you to run your local development server:
Install pip for Python 2
sudo apt update
sudo apt install python-pip
Install urlquote instead of py27_urlquote
pip install urlquote
Modify module.py located on your local directory from the error message
/Users/user/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py
Replace py27_urlquote to urlquote. There are 3 lines of code that uses py27_urlquote. Specifically lines 39, 833, and 836.
You can check this public tracker similar to your issue for more information and updates.
I just encountered this problem too on the SDK version 359.0.0
Instead of updating the SDK files manually, I opted for downgrading to a previous version.
I found that version 357.0.0 works fine.
To downgrade, run the following command:
gcloud components update --version 357.0.0
I try to install dash on a mac OS, and I have the following error when running 'import dash' on a python script:
Traceback (most recent call last):
File "app.py", line 16, in <module>
import dash
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/dash/__init__.py", line 5, in <module>
from .dash import Dash, no_update # noqa: F401,E402
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/dash/dash.py", line 17, in <module>
from flask_compress import Compress
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/flask_compress/__init__.py", line 1, in <module>
from .flask_compress import Compress
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/flask_compress/flask_compress.py", line 14, in <module>
import brotli
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/brotli.py", line 8, in <module>
import _brotli
ModuleNotFoundError: No module named '_brotli'
I can't figure it out what is the problem. I use python 3.7. I saw on the internet a similar issue on windows, but not on mac. I would be really grateful if you could help me.
You seem to have a broken installation of the brotli module (missing its native code component _brotli).
Try uninstalling it with pip uninstall brotli, then reinstall it; pip install brotli.
Going forward, I would heavily recommend you learn and use virtualenvs instead of installing everything into your Python's site-packages.
After uninstalling and installing again brotli it worked! Moreover, working in virtual environments is really more appropriate. Thank you a lot, AKX.
Whenever I try to use pip, using any command I get this:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsdra8p0\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsd8p0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_q3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:\Users\SE\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\progress_bars.py", line 8, in <module>
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
ModuleNotFoundError: No module named 'pip._vendor.progress'
PS C:\Users\SE> No module named 'pip._vendor.progress'No module named 'pip._vendor.progress'
I am on Windows 10, 64 bit, Python version 3.7.7.
I cannot use pip, how can I fix it?
If pip is broken after an attempted upgrade to a newer version, try the following:
Download get-pip.py and "Save As" the file using right-click.
Open a command prompt as an administrator
cd to the path where you saved the file, in my case
cd C:\Users\xyz\Downloads> then type python get-pip.py. It will install all required packages, such as wheel and pip.
To check if it installed correctly, type pip --version in the command line.
Hope my answer helps someone. Happy coding. 🙂
Try doing python -m pip install pytest. This should install it, and it will make it usable by your IDE.
Hope this helps!
You could follow the equivalent steps mentioned here and here (Both are closed issues on pip's github page) on your windows machine.
On windows you can do this:
python -m pip uninstall pip setuptools # Sometimes setuptools might be the problem
This will uninstall pip and setuptools.
After which you can reinstall them using
python -m ensurepip
This will install pip and setuptools.
I have tried this on my windows 10 machine running Python 3.7.4!
I'm trying to use PyOpenCL via SSH on Ubuntu, but when I get in the "prg = cl.Program(ctx, kernel).build()" it returns
`Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 141, in build
options = options + ["-I", _find_pyopencl_include_path()]
File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 722, in _find_pyopencl_include_path
from pkg_resources import Requirement, resource_filename
ImportError: No module named pkg_resources`
The program I'm trying to build is the oficial from PyOpenCL documentation (https://documen.tician.de/pyopencl/index.html).
You just have to install the python-pkg-resources package, which provides the python package called "pkg_resources".
For other distributions, the setuptools for python package might be needed.
i had the same problem that u have mentioned above n the solution worked for me is that i have to update my setuptools
pip install --upgrade setuptools
n after doing that it works...
its also handy for some other packages.
I am trying to convert the training text file to bin file for training the textsum of tensorflow. But I encountered the following error:
$ python textsum/data_convert_example.py --command text_to_binary --in_file data/tt.txt --out_file data/bin_data_train
Traceback (most recent call last):
File "textsum/data_convert_example.py", line 12, in <module>
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 104, in <module>
from tensorflow.python.platform import test
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/test.py", line 57, in <module>
import mock # pylint: disable=g-import-not-at-top,unused-import
File "/usr/local/lib/python2.7/dist-packages/mock/__init__.py", line 2, in <module>
import mock.mock as _mock
File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 71, in <module>
_v = VersionInfo('mock').semantic_version()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 461, in semantic_version
self._semantic = self._get_version_from_pkg_resources()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 448, in _get_version_from_pkg_resources
result_string = packaging.get_version(self.package)
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 755, in get_version
name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.
Kindly help me. I am using tensorflow 1.2.0 with python 2.7.2.
You must have a problem with your install.
Please try the following commands:
pip install --upgrade mock
pip install --upgrade distribute
If it does not work, you should give us more details about how you installed tensorflow (pip? conda? clone & setup.py?) and try to reinstall from scratch.
Hope it helps
I had the same issue (however not related to tensorflow) and in my case updating setuptools was the fix.
I've found the suggestion here:
https://github.com/testing-cabal/mock/issues/314
Before update I had setuptools 0.6c11 and I've updated to latest 39.2.0.
pip install --upgrade setuptools
or actually in my case I had to download and install locally since production server has no connection to internet:
pip download setuptools
pip install setuptools-39.2.0-py2.py3-none-any.whl