PermissionError: [Errno 13] Permission denied: '/usr/local/bin/markdown_py'

I just want to upgrade some modules that satisfy the running of my program. However, every time I use command like "pip3.5 install -- upgrade [module name]" ,there is always a exception like this.

pip3.5 install --upgrade tensorflow                                                                                         
Collecting tensorflow
  Using cached tensorflow-1.2.0-cp35-cp35m-manylinux1_x86_64.whl
Requirement already up-to-date: six>=1.10.0 in /usr/local/lib/python3.5/dist-packages (from tensorflow)
Collecting markdown==2.2.0 (from tensorflow)
Requirement already up-to-date: wheel>=0.26 in /usr/local/lib/python3.5/dist-packages (from tensorflow)
Collecting bleach==1.5.0 (from tensorflow)
Collecting werkzeug>=0.11.10 (from tensorflow)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting backports.weakref==1.0rc1 (from tensorflow)
  Using cached backports.weakref-1.0rc1-py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow)
  Using cached numpy-1.13.0-cp35-cp35m-manylinux1_x86_64.whl
Requirement already up-to-date: html5lib==0.9999999 in /usr/local/lib/python3.5/dist-packages (from tensorflow)
Collecting protobuf>=3.2.0 (from tensorflow)
  Using cached protobuf-3.3.0-cp35-cp35m-manylinux1_x86_64.whl
Collecting setuptools (from protobuf>=3.2.0->tensorflow)
  Using cached setuptools-36.0.1-py2.py3-none-any.whl
Installing collected packages: markdown, bleach, werkzeug, backports.weakref, numpy, setuptools, protobuf, tensorflow
  Found existing installation: Markdown 2.6.6
    Uninstalling Markdown-2.6.6:
Traceback (most recent call last):
  File "/usr/lib/python3.5/", line 538, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/usr/local/bin/markdown_py' -> '/tmp/pip-wpjongrp-uninstall/usr/local/bin/markdown_py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pip/", line 215, in main
status =, args)
  File "/usr/local/lib/python3.5/dist-packages/pip/commands/", line 342, in run
  File "/usr/local/lib/python3.5/dist-packages/pip/req/", line 778, in install
  File "/usr/local/lib/python3.5/dist-packages/pip/req/", line 754, in uninstall
  File "/usr/local/lib/python3.5/dist-packages/pip/req/", line 115, in remove
renames(path, new_path)
  File "/usr/local/lib/python3.5/dist-packages/pip/utils/", line 267, in renames
shutil.move(old, new)
  File "/usr/lib/python3.5/", line 553, in move
PermissionError: [Errno 13] Permission denied: '/usr/local/bin/markdown_py'

How can I solve this?


this link solves for installing what about uninstalling

It's just the same except with uninstall instead of install.