Cannot uninstall 'requests'. It is a distutils installed project

razcads
razcads edited June 2018 in Python client
Hi Guys
I am unable to install kiteconnect on my RHEL 7.5 64 bit system. I am getting this error. Can you check and advice. I have checked other threads on the same topic here but that didnt help. Not sure whats wrong.
sudo pip install kiteconnect --upgrade --pre
Collecting kiteconnect
Using cached https://files.pythonhosted.org/packages/db/29/ea9af33629f6a27a6b07d9130efcc645cafd7d3642ec22be4088477f8a8f/kiteconnect-3.7.3.tar.gz
Collecting requests>=2.18.4 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/cc/15/e1c318dbc20032ffbe5628837ca0de2d5b116ffd1b849c699634010f6a5d/requests-2.19.0-py2.py3-none-any.whl
Collecting six>=1.11.0 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting pyOpenSSL>=17.5.0 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/96/af/9d29e6bd40823061aea2e0574ccb2fcf72bfd6130ce53d32773ec375458c/pyOpenSSL-18.0.0-py2.py3-none-any.whl
Collecting enum34>=1.1.6 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting python-dateutil>=2.6.1 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl
Collecting autobahn[twisted]>=17.10.1 (from kiteconnect)
Using cached https://files.pythonhosted.org/packages/c9/7a/140264ec2c162bb22f91be76a11554f8ab0eda9bb2c775b6bc0dbbef0d4a/autobahn-18.6.1-py2.py3-none-any.whl
Requirement not upgraded as not directly required: idna<2.8,>=2.5 in /usr/lib/python2.7/site-packages (from requests>=2.18.4->kiteconnect) (2.7)
Requirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests>=2.18.4->kiteconnect) (3.0.4)
Requirement not upgraded as not directly required: urllib3<1.24,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests>=2.18.4->kiteconnect) (1.23)
Requirement not upgraded as not directly required: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests>=2.18.4->kiteconnect) (2018.4.16)
Collecting cryptography>=2.2.1 (from pyOpenSSL>=17.5.0->kiteconnect)
Using cached https://files.pythonhosted.org/packages/dd/c2/3a5bfefb25690725824ade71e6b65449f0a9f4b29702cce10560f786ebf6/cryptography-2.2.2-cp27-cp27mu-manylinux1_x86_64.whl
Collecting txaio>=2.10.0 (from autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/dc/2e/c8a877b0a5c2798fa93ebcc1465a72a68c089e5f8b0a852ca335751dcc5a/txaio-2.10.0-py2.py3-none-any.whl
Collecting zope.interface>=3.6.0; extra == "twisted" (from autobahn[twisted]>=17.10.1->kiteconnect)
Collecting Twisted>=12.1.0; extra == "twisted" (from autobahn[twisted]>=17.10.1->kiteconnect)
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect)
Using cached https://files.pythonhosted.org/packages/14/dd/3e7a1e1280e7d767bd3fa15791759c91ec19058ebe31217fe66f3e9a8c49/cffi-1.11.5-cp27-cp27mu-manylinux1_x86_64.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Requirement not upgraded as not directly required: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect) (1.0.16)
Requirement not upgraded as not directly required: setuptools in /usr/lib/python2.7/site-packages (from zope.interface>=3.6.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (39.2.0)
Collecting hyperlink>=17.1.1 (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/a7/b6/84d0c863ff81e8e7de87cff3bd8fd8f1054c227ce09af1b679a8b17a9274/hyperlink-18.0.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/17/6a/1baf488c2015ecafda48c03ca984cf0c48c254622668eb1732dbe2eae118/Automat-0.6.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d75335a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl
Collecting constantly>=15.1 (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/b9/65/48c1909d0c0aeae6c10213340ce682db01b48ea900a7d9fce7a7910ff318/constantly-15.1.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect)
Collecting attrs (from Automat>=0.3.0->Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect)
Using cached https://files.pythonhosted.org/packages/41/59/cedf87e91ed541be7957c501a92102f9cc6363c623a7666d69d51c78ac5b/attrs-18.1.0-py2.py3-none-any.whl
Building wheels for collected packages: kiteconnect
Running setup.py bdist_wheel for kiteconnect ... error
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-EiHG2I/kiteconnect/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-jmjNAm --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: option -d not recognized

----------------------------------------
Failed building wheel for kiteconnect
Running setup.py clean for kiteconnect
Failed to build kiteconnect
Installing collected packages: requests, six, pycparser, cffi, enum34, asn1crypto, cryptography, pyOpenSSL, python-dateutil, txaio, zope.interface, hyperlink, attrs, Automat, incremental, constantly, Twisted, autobahn, kiteconnect
Found existing installation: requests 2.6.0
Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
  • zartimus
    @razcads It seems pip is trying to upgrade requests lib and failing. Can you try `pip install requests --upgrade`? Also you should not ideally use sudo, everything should happen inside virtualenv. You can even skip installing dependencies if the environment already has it (at least 3.7.0). `pip install kiteconnect --upgrade --no-deps`
  • razcads
    Hi @zartimus
    Thanks for the inputs but when I try to upgrade requests I get this error.
    Collecting requests
    Using cached https://files.pythonhosted.org/packages/cc/15/e1c318dbc20032ffbe5628837ca0de2d5b116ffd1b849c699634010f6a5d/requests-2.19.0-py2.py3-none-any.whl
    Requirement not upgraded as not directly required: idna<2.8,>=2.5 in /usr/lib/python2.7/site-packages (from requests) (2.7)
    Requirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests) (3.0.4)
    Requirement not upgraded as not directly required: urllib3<1.24,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests) (1.23)
    Requirement not upgraded as not directly required: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests) (2018.4.16)
    Installing collected packages: requests
    Found existing installation: requests 2.6.0
    Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
  • razcads
    i am running python 2.7.5
  • zartimus
    @razcads Why dont you use virtualenv? I can see tons of results on google regarding this.
  • razcads
    @zartimus well I don't have a need for virtual env so not going for it. Well looks like I just may have to now. Strange just recently I had kiteconnect installed in another linux machine without an issue.
This discussion has been closed.