Python modules with "-(hyphen)" cannot be removed

Check the dependencies between modules with pip check

When I checked it with pip check, I got the following error.

$ pip check
-iskit 0.13.0 requires qiskit-aer, which is not installed.
-iskit 0.13.0 requires qiskit-aqua, which is not installed.
-iskit 0.13.0 requires qiskit-ibmq-provider, which is not installed.
-iskit 0.13.0 requires qiskit-ignis, which is not installed.
-iskit 0.13.0 requires qiskit-terra, which is not installed.
tensorflow 2.1.0 has requirement gast==0.2.2, but you have gast 0.3.3.
tensorflow 2.1.0 has requirement tensorboard<2.2.0,>=2.1.0, but you have tensorboard 2.2.0.
mysql-connector-python 8.0.19 has requirement protobuf==3.6.1, but you have protobuf 3.11.3.

I got a hit with -iskit, which was previously installed, but it should have already been uninstalled. I don't want the check result to appear, so I tried uninstalling it and got an error.

$ pip show ~iskit
zsh: no such user or named directory: iskit
$ pip uninstall ~iskit
zsh: no such user or named directory: iskit
$ pip uninstall "~iskit"
ERROR: Invalid requirement: '~iskit'

Various confirmation

$ pip list
Package                           Version
--------------------------------- --------------------
-                                 xopt
-.bsockets                        7.0
-.fi                              1.13.2
-.re-itertools                    8.0.2
-.scf                             1.6.5
-.st-asyncio                      1.2.1
-.xopt                            1.2.3
(Omitted below)

A lot of garbage!

Is there an entity?

/usr/local/lib/python3.7/site-packages $ ls -l|grep  -e "~"
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~%bsockets-7.0.dist-info
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~%re_itertools-5.0.0.dist-info
drwxrwxr-x     - nandymak admin 2020-01-02 22:07 ~%re_itertools-8.0.2.dist-info
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~%scf-1.6.5.dist-info
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~%st_asyncio-1.0.0.dist-info
drwxrwxr-x     - nandymak admin 2020-01-02 22:07 ~%st_asyncio-1.2.1.dist-info
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~%xopt-1.2.3.dist-info
drwxrwxr-x     - nandymak admin 2019-11-29 23:33 ~iskit-0.13.0.dist-info
(Omitted below)

There are a lot of folders with "~ (tilde)". As far as I can see, it doesn't seem to be the currently installed module. I tried google, but I couldn't find any such information. By saying that

delete

/usr/local/lib/python3.7/site-packages $ ls |grep  -e "~"
~%bsockets-7.0.dist-info
~%re_itertools-5.0.0.dist-info
~%re_itertools-8.0.2.dist-info
~%scf-1.6.5.dist-info
(Omitted below)

Check again,

/usr/local/lib/python3.7/site-packages $ for item in `ls |grep  -e "~"` ; do
rm -rf ./$item
done
pip list                                                                                                                   
Package                           Version             
--------------------------------- --------------------
absl-py                           0.7.1               
alabaster                         0.7.12              
annofabapi                        0.29.5              
appdirs                           1.4.3               
appnope                           0.1.0 
(Omitted below)

It has become beautiful.

** Please do it at your own risk ** In my case, I was planning to start over if something went wrong (^ _ ^;)

bonus

I was getting the following error in tensorflow.

tensorflow 2.1.0 has requirement gast==0.2.2, but you have gast 0.3.3.
tensorflow 2.1.0 has requirement tensorboard<2.2.0,>=2.1.0, but you have tensorboard 2.2.0.

When I checked it with Google Colaboratory,

!pip list|grep tensorflow
tensorflow               2.2.0rc1       
tensorflow-addons        0.8.3          
tensorflow-datasets      2.1.0          
tensorflow-estimator     2.2.0rc0       
tensorflow-gcs-config    2.1.8          
tensorflow-hub           0.7.0          
tensorflow-metadata      0.21.1         
tensorflow-privacy       0.2.2          
tensorflow-probability   0.9.0       

The main body is up to 2.2.0rc1. If the default of Google Colaboratory is 2.2.0rc1, let's match it.

!pip list|grep tensorflow|awk '{print "pip install "$1"=="$2}'
pip install tensorflow==2.2.0rc1
pip install tensorflow-addons==0.8.3
pip install tensorflow-datasets==2.1.0
pip install tensorflow-estimator==2.2.0rc0
pip install tensorflow-gcs-config==2.1.8
pip install tensorflow-hub==0.7.0
pip install tensorflow-metadata==0.21.1
pip install tensorflow-privacy==0.2.2
pip install tensorflow-probability==0.9.0

Copy the line pip install tensorflow ~ ~ and paste it into the Terminal on the Local side to install, and the error no longer appears.

** Please do it at your own risk **

Recommended Posts

Python modules with "-(hyphen)" cannot be removed
Project cannot be created with Python3.5 (Windows) + django1.7.1
Investigation when import cannot be done with python
Solution when the image cannot be displayed with tkinter [python]
Video cannot be loaded with Spyder in Python development environment
(Note) Be careful with python argparse
RPC completed with standard Python3 modules
Items that cannot be imported with sklearn
Modules cannot be imported in Python on EC2 run from AWS Lambda
Address to the bug that node.surface cannot be obtained with python3 + mecab
FizzBuzz with Python3
Scraping with Python
When contour map cannot be drawn with APLpy
Scraping with Python
"Temporary solution" when pip cannot be updated [Python]
Python with Go
Twilio with Python
Integrate with Python
Play with 2016-Python
Python environment settings (virtualenv + pip cannot be done)
AES256 with python
Tested with Python
python starts with ()
No module named'distutils.util' cannot be used with get-pip.py
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
PIL cannot be installed by virtualenv with pyenv
Excel with Python
Microcomputer with Python
De-VBA Excel tool! Eliminate VBA tool with Python in environment where Python cannot be installed
Cast with python
Workaround for the problem that UTF-8 Japanese mail cannot be sent with Flask-Mail (Python3)
Python note: When the pip command cannot be used
Japanese can be used with Python in Docker environment
Import libraries that cannot be pip installed with PyCharm
Python knowledge notes that can be used with AtCoder
[Memorandum] Japanese keys cannot be used in python string.Template.substitute
[android] When AVD cannot be used with permission denied
Causes when python version cannot be changed using pyenv
list comprehension because operator.methodcaller cannot be used in python 2.5
Operators ++,-cannot be used in python (difference from php)
[Redash] Standard library cannot be used in python function
Serial communication with Python
Zip, unzip with python
Django 1.11 started with Python3.6
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
List of python modules
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
Sequential search with Python
"Object-oriented" learning with python
Handling yaml with python
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER