Cassandra installation error - DRIVER in python

Asked

Viewed 197 times

1

Hello, I’m trying to create a development environment with python and Cassandra, however I’m having difficulties to install the connector in python, follows below the environment I currently have the error that I’m having of return. Operating System: Windows 8.1 Python : Version 3.6 Anaconda : Version 3.x

I installed the Notebook and it is working, the Anaconda I installed because I need the Notebook Jupyter to do a job, and in this work I need to connect to the database, to install the connector I did the following 1 attempt I went in python and gave the following command via windows Power Shell . PIP INSTALL CASSANDRA-DRIVER

and I’m getting this error return

Collecting Charger-driver Downloading Cab-driver-3.12. 0.tar. gz (222kB) 100% |████████████████████████████████| 225kB 2.0MB/s Requirement already satisfied: six>=1.9 in c: users rodrigoaugusto appdata local Programs python python36-32 lib site-pa ckages (from Freedriver) Installing collected Packages: Cassandra-driver Running setup.py install for Cassandra-driver ... error Exception: Traceback (Most recent call last): File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip compat__init__.py", Lin and 73, in console_to_str Return s.Decode(sys.stdout.encoding) Unicodedecodeerror: 'utf-8' codec can’t Decode byte 0xf3 in position 9: invalid continuation byte

During Handling of the above Exception, Another Exception occurred:

Traceback (Most recent call last): File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip basecommand.py", line 21 5, in main status = self.run(options, args) File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip Commands install.py", li ne 342, in run prefix=options.prefix_path, File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip req req_set.py", line 78 4, in install **kwargs File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip req req_install.py", Lin and 878, in install spinner=spinner, File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip utils__init__.py", line 676, in call_subprocess line = console_to_str(proc.stdout.readline()) File "c: users rodrigoaugusto appdata local Programs python python36-32 lib site-Packages Pip compat__init__.py", Lin and 75, in console_to_str Return s.Decode('utf_8') Unicodedecorror: 'utf-8' codec can’t Decode byte 0xf3 in position 9: invalid continuation byte

2 Attempt was inside the Conda , I gave the command to install and gave the same error, I do not know what may be happening and I have no technical ability to identify what error and this, I would like a help to try to solve this problem.

1 answer

1


This is an encoding error - unfortunately, 25 years after the world has standardized an accents encoding that accepts characters from all over the world - utf-8, microsoft with windows continues to use partial codifications that are language-specific. In the case of windows (yours is about 4 years old, but even in windows 10 have not changed it).

Its traceback shows where the error occurs, one of the components of the installation reads the output of a sub-process to the standard output and tries to treat it as text - and the subprocess of the standard output prints an accented character -- which uses the encoding "latin1" Windows, but invalid in "utf-8" encoding assumed by PIP.

"...pip\utils__init__.py", line 676, in call_subprocess line = console_to_str(proc.stdout.readline()) "

This is a PIP bug. The catactere that it shows is utf-8 invalid, code \xf3 corresponds to the caractpere ó in Latin-1.

One way to get around the error is to set up your system language in English - even temporarily - do this, and run the installation of the English driver.

If you have problems using the driver afterwards, the business is to keep everything in English even.

Theoretically you don’t need to change the entire Windows language to do this - just set up the environment variable LANG in the Powershell where to run the PIP. But windows is not known to be consistent with these things. Anyway, try typing the command $env:LANG=C on the powershell terminal before trying the pip install as you did above.

(in time: Why then does the error not happen with all Python packages? Good - most Python packages do not translate your messages, and an even smaller number translates the printed messages during the installation - It turns out that this Cassandra driver is printing the translated messages, as indicated by the presence of this letter ó that caused the error)

  • Note for who I’ve been in windows: if you can reproduce the error, it’s worth opening an Issue on the PIP github: https://github.com/pypa/pip/issues - one or two context phrases and the traceback above should be enough.

  • Thank you worked out here.

  • Already corrected in the PIP development code - in version 10 the problem must be solved: https://answall.com/a/269710/500

Browser other questions tagged

You are not signed in. Login or sign up in order to post.