Unable to use pip command in CDP
You may not be able to use the pip command in CDP releases 7.1.7 and above and may see the following error when using pip in a command: “ImportError: cannot import name chardet”.
To fix this issue and use the
pip command, you must download
pip from pypi.org
chardet package to the target directory.
- SSH into the Hue host as a root user.
Change to the following directory:
Check the pip version by running the following command:
pippackage by running the following command:
wget https://files.pythonhosted.org/packages/53/7f/55721ad0501a9076dbc354cc8c63ffc2d6f1ef360f49ad0fbcce19d68538/pip-20.3.4.tar.gz -O ~/pip-20.3.4.tar.gz
tarfile by running the following command:
tar xvzf ~/pip-20.3.4.tar.gz -C ~
chardetpackage to the target directory by running the following command:
cp -R ~/pip-20.3.4/src/pip/_vendor/chardet build/env/lib/python2.7/site-packages/pip/_vendor/.
Verify that you can run a pip command without any error by running any of the
following sample commands: