Cassandra installation error - DRIVER in python

1
Hello, I'm trying to create a development environment with python and Cassandra, but I'm having trouble installing the Connector in python, I'm following the environment that I currently have the error that I'm having to return. Operating System: Windows 8.1 Python: Version 3.6 Anaconda: Version 3.x

I installed the cassandra and it is working, the Anaconda I installed because I need the Jupyter Notebook to do a job, and in this work I need to connect to the cassandra 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 having this error return

  

Collecting cassandra-driver Downloading   cassandra-driver-3.12.0.tar.gz (222kB)       100% | ████████████████████████████████ | 225kB 2.0MB / s Requirement already satisfied: six > = 1.9 in   c: \ users \ librigoaugusto \ appdata \ local \ programs \ python \ python36-32 \ lib \ site-pa   ckages (from cassandra-driver) 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 __.   lin and 73, in console_to_str       return s.decode (sys. stdout .encoding) UnicodeDecodeError: 'utf-8' codec can not decode byte 0xf3 in position 9: invalid   continuation byte

     

During handling of the above exception, another exception occurred:

     

Traceback (most recent call last): File   "p: \ python36-32 \ lib \ site-packages \ pip \ basecommand.py", c: \ users \ rodrigoaugusto \ appdata \ local \ programs \   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 \ rougoaugusto \ 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 __.   line 676, in call_subprocess       If you do not want to run the program, you will need to run the following command: python36-32 \ lib \ site-packages \ pip \ compat__init __. py ", line = console_to_str (proc.stdout.readline ()   lin and 75, in console_to_str       return s.decode ('utf_8') UnicodeDecodeError: 'utf-8' codec can not 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 do not have the technical capacity to identify that error and this, I would like some help to try to solve this problem.

    
asked by anonymous 29.12.2017 / 12:11

1 answer

1
Unfortunately, 25 years after the world has standardized an encoding of accents that accepts characters from around the world - utf-8, microsoft with windows continues to use partial encodings that are language-specific . In the case of windows (yours is a 4 year old, but even in windows 10 did not change that).

Your traceback shows where the error occurs, one of the components of the installation reads the output of a subprocess to the standard output and tries to treat it as text - and the subprocess of the standard output prints one accented character - which uses the "latin1" encoding of Windows, but is invalid in the "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 that is invalid utf-8, code \xf3 corresponds to the ó character in Latin-1.

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

If you have trouble using the driver later, the deal is to keep everything in English yourself.

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

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

    
29.12.2017 / 13:41