Recently, I have installed Cassandra. 3.6
After installation, I got an error.
Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError('ref() does not take keyword arguments',)})
To solve this, I have followed
pip install cassandra-driver==2.7.2
pip install cassandra-driver
export CQLSH_NO_BUNDLED=true
And my python version is 2.7
right Now, when I run cqlsh, I'm getting following error
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 167, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling
File "/usr/lib/python2.7/dist-packages/cqlshlib/cql3handling.py", line 17, in <module>
from .cqlhandling import CqlParsingRuleSet, Hint
File "/usr/lib/python2.7/dist-packages/cqlshlib/cqlhandling.py", line 21, in <module>
from cassandra.metadata import cql_keywords_reserved
ImportError: cannot import name cql_keywords_reserved
How can I solve this error? How can I run cassandra withour errors?
You are seeing CASSANDRA-11840, which occurs with older versions of the driver with Python 2.7.12+.
To work around it, either
1.) Upgrade to Cassandra 3.8+, which bundles a driver version that does not have this problem.
or
2.) Make your environment/PATH use Python <= 2.7.11
or
3.) CQLSH_NO_BUNDLED=1 as you guessed, but install a version of the driver that has the fix (cassandra-driver >= 3.4.0).
Related
So I have python version 3.8.12, and while trying to build a cloudrun app, I get the error:
ERROR: gcloud failed to load: module 'collections' has no attribute 'Mapping'
Now when I try to run and install Gcloud SDK again, I get the error:
Welcome to the Google Cloud SDK! Traceback (most recent call last): File "/Users/eshanchatty/downloads/./google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping File "/Users/eshanchatty/Downloads/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 46, in <module>
from googlecloudsdk.core.updater import update_manager File "/Users/eshanchatty/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/updater/update_manager.py", line 39, in <module>
from googlecloudsdk.core.console import progress_tracker File "/Users/eshanchatty/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/console/progress_tracker.py", line 651, in <module>
class _BaseStagedProgressTracker(collections.Mapping): AttributeError: module 'collections' has no attribute 'Mapping'
What is causing this, and how can I solve this?
Yesterday I updated Fedora to version 35. This version uses Python 3.10 by default.
In this version, collections does not have Mapping. I got the same errors as you did.
I haven't tried to reinstall Google Cloud SDK. Instead, I wrote this line to my ~/.bashrc file:
export CLOUDSDK_PYTHON=python2
Then closed and opened the terminal.
Now the SDK uses Python 2 instead of Python 3. This solved the issue for me.
I used this doc to fix my python on macos, eventually after fixing python the issue got resolved.
https://gist.github.com/MuhsinFatih/ee0154199803babb449b5bb98d3475f7
I've gotten my hands on a AIY voice kit v1 and am stuck with the assistant_grpc_demo.py with it failing at an import statement with the grpc. I should have everything installed already, yet google.auth.transport can't seem to find it. I am using a pi 3 A+. Below is the terminal commands I used and their outputs.
pi#raspberrypi:~ $ cat testinput.py
import google.auth.transport.grpc
pi#raspberrypi:~ $ python3 testinput.py
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 30, in <module>
import grpc
File "/home/pi/.local/lib/python3.7/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/home/pi/.local/lib/python3.7/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/pi/.local/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "testinput.py", line 1, in <module>
import google.auth.transport.grpc
File "/home/pi/.local/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 37, in <module>
caught_exc,
File "<string>", line 3, in raise_from
ImportError: gRPC is not installed, please install the grpcio package to use the gRPC transport.
*Maybe the glibc part is the problem. Not sure how to resolve that as I already have libc6 2.28. Is there a way to get the aiy-python-wheels to work with my set-up or a previous version. Already tried flashing a pre-built official image built on 4-13-2018 with everything set up, though it failed to boot. Trying to download all packages manually. assistant_library_with_button.sh works though.
Not sure how to resolve that as I already have libc6 2.28
The error message says: .../site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so requires GLIBC_2.33.
Your libc6 is too old for that gRPC package to work -- it was compiled on a newer system.
You must either:
get a different gRPC package -- one compiled on and suitable for running on a GLIBC-2.28 (or earlier) based system, or
get a different GLIBC package (2.33 or later).
Trying to use SharePlum, but getting this error when importing :-
>>> from shareplum import Office365
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/myac/.local/lib/python2.7/site-packages/shareplum/__init__.py", line 5, in <module>
from .office365 import Office365 # noqa: F401
File "/home/myac/.local/lib/python2.7/site-packages/shareplum/office365.py", line 6, in <module>
from .request_helper import post
File "/home/myac/.local/lib/python2.7/site-packages/shareplum/request_helper.py", line 2, in <module>
from .errors import ShareplumRequestError
File "/home/myac/.local/lib/python2.7/site-packages/shareplum/errors.py", line 4
super().__init__(f"{msg} : {details}")
I've installed shareplum, requests, requests-ntlm, requests-toolbelt, and lxml but I keep getting this error.
Any clues?
The Shareplum version that you've installed has been configured on your python 2.7 interpreter(this is your default python version), though the version is 0.5.1, which is not supported on Python2.7: https://pypi.org/project/SharePlum/0.5.1/
Either you downgrade you Shareplum version to the one which is compatible with python2.7 i.e. https://pypi.org/project/SharePlum/0.3.0/
pip install shareplum==0.3.0
or
Make use of Python3 and install latest shareplum for that :
pip3 install shareplum
And when running terminal or the script, please make use of python3 binary instead of python
I followed the procedure given on the Pelican website by:
Creating a virtualenv and then source bin/activate
Installing pelican using pip install pelican
Writing pelican-quickstart
When I typed in pelican-quickstart, I got the following error:
Traceback (most recent call last):
File "/home/ashutosh_mishra/virtualenvs/pelican/bin/pelican-quickstart", line 7, in <module>
from pelican.tools.pelican_quickstart import main
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/pelican/__init__.py", line 19, in <module>
from pelican.generators import (ArticlesGenerator, PagesGenerator,
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/pelican/generators.py", line 14, in <module>
from jinja2 import (BaseLoader, ChoiceLoader, Environment, FileSystemLoader,
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/home/ashutosh_mishra/virtualenvs/pelican/lib/python3.2/site-packages/jinja2/environment.py", line 677
u'\xff\xff\xff\xff'.encode('iso-8859-15')
^
SyntaxError: invalid syntax
I googled the error and found Pelican 3.3 pelican-quickstart error "ValueError: unknown locale: UTF-8"', but this doesn't solve my problem.
Can anyone suggest a solution?
While the error traceback points to an issue with Jinja2 and not Pelican directly, the most likely cause is Python 3.2 — that version of Python is rather old and is no longer supported by either the Jinja2 or Pelican development teams.
Upgrading your operating system may allow your package manager to install a more recent Python version (3.4+ recommended). Alternatively, you can use a tool such as PyEnv to install the latest version of Python without having to upgrade your operating system.
When I tried to run mysqldbcopy utility I get the following error.
mysqldbcopy --source=root:root#localhost:3306 \
--destination=root:root#localhost:3306 first:first_copy
Traceback (most recent call last):
File "/usr/bin/mysqldbcopy", line 24, in <module>
from mysql.utilities.common.tools import check_python_version
ImportError: No module named mysql.utilities.common.tools
I have checked that python (2.6) is installed on my machine.
I have installed mysql python connector mentioned at http://dev.mysql.com/downloads/connector/python/
I have installed mysql utilities from
https://dev.mysql.com/downloads/utilities/
I am not sure why I am still getting that error.