spacy showing import module error while it is already installed - python

spacy is installed in vir env in python console
Building wheels for collected packages: en-core-web-sm Building
wheel for en-core-web-sm (setup.py) ... done Created wheel for
en-core-web-sm: filename=en_core_web_sm-2.1.0-cp36-none-any.whl
size=11074439
sha256=f67b5d1a325b5d49f50c2a0765610c51d01ff2644e78fa8568fc141506dac87c
Stored in directory:
C:\Users\DUDE\AppData\Local\Temp\pip-ephem-wheel-cache-02mgn7_m\wheels\39\ea\3b\507f7df78be8631a7a3d7090962194cf55bc1158572c0be77f
Successfully built en-core-web-sm Installing collected packages:
en-core-web-sm Successfully installed en-core-web-sm-2.1.0 ✔ Download
and installation successful You can now load the model via
spacy.load('en_core_web_sm') You do not have sufficient privilege to
perform this operation. ✘ Couldn't link model to 'en' Creating a
symlink in spacy/data failed. Make sure you have the required
permissions and try re-running the command as admin, or use a
virtualenv. You can still import the model as a module and call its
load() method, or create the symlink manually.
E:\anaconda\envs\textmining\lib\site-packages\en_core_web_sm -->
E:\anaconda\envs\textmining\lib\site-packages\spacy\data\en ⚠ Download
successful but linking failed Creating a shortcut link for 'en' didn't
work (maybe you don't have admin permissions?), but you can still load
the model via its full package name: nlp =
spacy.load('en_core_web_sm')
Tried this in jupyter notebook
!pip install spacy
Requirement already satisfied: spacy in
e:\anaconda\envs\textmining\lib\site-packages (2.1.8) Requirement
already satisfied: blis<0.3.0,>=0.2.2 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.2.4)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.22.0)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (1.0.2)
Requirement already satisfied: wasabi<1.1.0,>=0.2.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.2.2)
Requirement already satisfied: srsly<1.1.0,>=0.0.6 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.1.0)
Requirement already satisfied: numpy>=1.15.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (1.17.1)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.9.6)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.0.2)
Requirement already satisfied: preshed<2.1.0,>=2.0.1 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.0.1)
Requirement already satisfied: thinc<7.1.0,>=7.0.8 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (7.0.8)
Requirement already satisfied: certifi>=2017.4.17 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (2019.6.16) Requirement already
satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (1.25.3) Requirement already
satisfied: chardet<3.1.0,>=3.0.2 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (3.0.4) Requirement already satisfied:
idna<2.9,>=2.5 in e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (2.8) Requirement already satisfied:
tqdm<5.0.0,>=4.10.0 in e:\anaconda\envs\textmining\lib\site-packages
(from thinc<7.1.0,>=7.0.8->spacy) (4.35.0)
import spacy
tok=spacy.load("en")
doc=tok(test_sentence)
[x.text for x in doc]
Getting error ModuleNotFoundError Traceback
(most recent call last) in
----> 1 import spacy
2 tok=spacy.load("en")
3
4 doc=tok(test_sentence)
5 [x.text for x in doc]
ModuleNotFoundError: No module named 'spacy'

I was able to run the spacy in python console, so I assumed the problem was with jupyter notebook. I followed https://anbasile.github.io/programming/2017/06/25/jupyter-venv/
what i did is, I added pip install ipykernel
then
ipython kernel install --user --name=projectname
At this point, you can start jupyter, create a new notebook and select the kernel that lives inside your environment.

I use windows, but its same for other OS. You should check your administrative rights and privilege. For Windows visit the User Account > Change User Account Control Settings > Pull down the bar to never notify. Try re running the install prompt. Should be fine.

Related

FormGroup was deprecated in dash-bootstrap-components version 1.0.0

I'm trying to copy the exact code here.
When I run:
from jaal import Jaal
from jaal.datasets import load_got
# load the data
edge_df, node_df = load_got()
# init Jaal and run server
Jaal(edge_df, node_df).plot()
The error I get is:
FormGroup was deprecated in dash-bootstrap-components version 1.0.0. You are using 1.0.0. For more details please see the migration guide: https://dbc-v1.herokuapp.com/migration-guide/
From the migration guide here, I followed 'pip install "dash-bootstrap-components<1"'
as suggested, and it installed like this:
Collecting dash-bootstrap-components<1
Downloading dash_bootstrap_components-0.13.1-py3-none-any.whl (197 kB)
|████████████████████████████████| 197 kB 2.0 MB/s eta 0:00:01
Requirement already satisfied: dash>=1.9.0 in ./anaconda/lib/python3.7/site-packages (from dash-bootstrap-components<1) (2.0.0)
Requirement already satisfied: flask-compress in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (1.4.0)
Requirement already satisfied: Flask>=1.0.4 in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (1.1.1)
Requirement already satisfied: dash-core-components==2.0.0 in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (2.0.0)
Requirement already satisfied: dash-table==5.0.0 in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (5.0.0)
Requirement already satisfied: dash-html-components==2.0.0 in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (2.0.0)
Requirement already satisfied: plotly>=5.0.0 in ./anaconda/lib/python3.7/site-packages (from dash>=1.9.0->dash-bootstrap-components<1) (5.3.1)
Requirement already satisfied: Werkzeug>=0.15 in ./anaconda/lib/python3.7/site-packages (from Flask>=1.0.4->dash>=1.9.0->dash-bootstrap-components<1) (0.15.4)
Requirement already satisfied: Jinja2>=2.10.1 in ./anaconda/lib/python3.7/site-packages (from Flask>=1.0.4->dash>=1.9.0->dash-bootstrap-components<1) (2.10.1)
Requirement already satisfied: click>=5.1 in ./anaconda/lib/python3.7/site-packages (from Flask>=1.0.4->dash>=1.9.0->dash-bootstrap-components<1) (7.0)
Requirement already satisfied: itsdangerous>=0.24 in ./anaconda/lib/python3.7/site-packages (from Flask>=1.0.4->dash>=1.9.0->dash-bootstrap-components<1) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in ./anaconda/lib/python3.7/site-packages (from Jinja2>=2.10.1->Flask>=1.0.4->dash>=1.9.0->dash-bootstrap-components<1) (1.1.1)
Requirement already satisfied: tenacity>=6.2.0 in ./anaconda/lib/python3.7/site-packages (from plotly>=5.0.0->dash>=1.9.0->dash-bootstrap-components<1) (8.0.1)
Requirement already satisfied: six in ./anaconda/lib/python3.7/site-packages (from plotly>=5.0.0->dash>=1.9.0->dash-bootstrap-components<1) (1.15.0)
Installing collected packages: dash-bootstrap-components
Attempting uninstall: dash-bootstrap-components
Found existing installation: dash-bootstrap-components 1.0.0
Uninstalling dash-bootstrap-components-1.0.0:
Successfully uninstalled dash-bootstrap-components-1.0.0
Successfully installed dash-bootstrap-components-0.13.
But then when I rerun the code segment above to build a network, the output is still the same error. I'm using python 3.7.3, knowing that is says that I must use 3.6+. Can anyone explain how to fix this?
I tried on conda enviroment:
conda install -c conda-forge "dash-bootstrap-components<1"
and then it's working.

Could not find a version that satisfies the requirement statsmodels.api [ Python ]

When I try pip install statsmodels.api command,
I had these errors
ERROR: Could not find a version that satisfies the requirement statsmodels.api (from versions: none)
ERROR: No matching distribution found for statsmodels.api
Python version is Python 3.8.5
C:\Windows\system32>pip install statsmodels
Requirement already satisfied: statsmodels in c:\python38\lib\site-packages (0.12.0)
Requirement already satisfied: numpy>=1.15 in c:\python38\lib\site-packages (from statsmodels) (1.19.1)
Requirement already satisfied: patsy>=0.5 in c:\python38\lib\site-packages (from statsmodels) (0.5.1)
Requirement already satisfied: pandas>=0.21 in c:\python38\lib\site-packages (from statsmodels) (1.1.2)
Requirement already satisfied: scipy>=1.1 in c:\python38\lib\site-packages (from statsmodels) (1.5.2)
Requirement already satisfied: six in c:\python38\lib\site-packages (from patsy>=0.5->statsmodels) (1.15.0)
Requirement already satisfied: python-dateutil>=2.7.3 in c:\python38\lib\site-packages (from pandas>=0.21->statsmodels) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in c:\python38\lib\site-packages (from pandas>=0.21->statsmodels) (2020.1)
I think you want this:
pip install statsmodels
You're trying to install one submodule of a Python module/package. You have to install the whole package.
If you've already done this, then you already have the statsmodels.api module and don't have to install anything else.
I do not know how you have configured your environments (if you have many). but ensure that you install your package in the correct environment. However, please try the following for me:
conda install -c anaconda statsmodels

Google Cloud storage: ModuleNotFoundError

I am facing a classic "Module not found error". However, I cannot solved my problem with the questions already posted.
I am trying to use the google.cloud API in order to download some data from a public Google repository to a local linux server.
Below are the instructions I used in a Jupyter server:
# Upgrading pip
!/usr/bin/python3.8 -m pip install --upgrade pip
# Installing the Google cloud storage API
!pip3 install google
!pip3 install google-cloud-storage
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: google in /home/antoine/.local/lib/python3.8/site-packages (3.0.0)
Requirement already satisfied: beautifulsoup4 in /home/antoine/.local/lib/python3.8/site-packages (from google) (4.9.1)
Requirement already satisfied: soupsieve>1.2 in /home/antoine/.local/lib/python3.8/site-packages (from beautifulsoup4->google) (2.0.1)
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: google-cloud-storage in /home/antoine/.local/lib/python3.8/site-packages (1.30.0)
Requirement already satisfied: google-cloud-core<2.0dev,>=1.2.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-cloud-storage) (1.4.1)
Requirement already satisfied: google-resumable-media<2.0dev,>=0.6.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-cloud-storage) (0.7.1)
Requirement already satisfied: google-auth<2.0dev,>=1.11.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-cloud-storage) (1.20.1)
Requirement already satisfied: google-api-core<2.0.0dev,>=1.19.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-cloud-core<2.0dev,>=1.2.0->google-cloud-storage) (1.22.1)
Requirement already satisfied: google-crc32c<0.2dev,>=0.1.0; python_version >= "3.5" in /home/antoine/.local/lib/python3.8/site-packages (from google-resumable-media<2.0dev,>=0.6.0->google-cloud-storage) (0.1.0)
Requirement already satisfied: six in /home/antoine/.local/lib/python3.8/site-packages (from google-resumable-media<2.0dev,>=0.6.0->google-cloud-storage) (1.15.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (4.1.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/lib/python3/dist-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (0.2.1)
Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in /home/antoine/.local/lib/python3.8/site-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (4.6)
Requirement already satisfied: setuptools>=40.3.0 in /usr/local/lib/python3.8/dist-packages (from google-auth<2.0dev,>=1.11.0->google-cloud-storage) (49.3.0)
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from google-api-core<2.0.0dev,>=1.19.0->google-cloud-core<2.0dev,>=1.2.0->google-cloud-storage) (2018.3)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /usr/lib/python3/dist-packages (from google-api-core<2.0.0dev,>=1.19.0->google-cloud-core<2.0dev,>=1.2.0->google-cloud-storage) (2.18.4)
Requirement already satisfied: protobuf>=3.12.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-api-core<2.0.0dev,>=1.19.0->google-cloud-core<2.0dev,>=1.2.0->google-cloud-storage) (3.13.0)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-api-core<2.0.0dev,>=1.19.0->google-cloud-core<2.0dev,>=1.2.0->google-cloud-storage) (1.52.0)
Requirement already satisfied: cffi>=1.0.0 in /home/antoine/.local/lib/python3.8/site-packages (from google-crc32c<0.2dev,>=0.1.0; python_version >= "3.5"->google-resumable-media<2.0dev,>=0.6.0->google-cloud-storage) (1.14.1)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/lib/python3/dist-packages (from rsa<5,>=3.1.4; python_version >= "3.5"->google-auth<2.0dev,>=1.11.0->google-cloud-storage) (0.4.2)
Requirement already satisfied: pycparser in /home/antoine/.local/lib/python3.8/site-packages (from cffi>=1.0.0->google-crc32c<0.2dev,>=0.1.0; python_version >= "3.5"->google-resumable-media<2.0dev,>=0.6.0->google-cloud-storage) (2.20)
from google.cloud import storage
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-48-d626caf5a463> in <module>
----> 1 from google.cloud import storage
2
3
4 def download_blob(bucket_name, source_blob_name, destination_file_name):
5 """Downloads a blob from the bucket."""
ModuleNotFoundError: No module named 'google'
Thank you for your advice!
Sometimes, when you have multiple versions of Python installed (with multiple Python 3.X versions), using pip3 is not enough, as it does not necessarily install a package for the latest version of Python installed on your machine.
You can check what version of python your pip3 is using by using the pip3 --version command.
If you plan to run a script with Python 3.8 and need to install a package for this specific version of Python, you can use:
pip3.8 install PACKAGE or
python3.8 -m pip install PACKAGE

pip install fail: Terminal lists most recent attempts of package installation, won't install packages

In an attempt to access and run Matlab code via Jupyter notebook and Python, I tried installing 'matlab_kernal' (w/ typo) and 'matlab_kernel' as suggested by a blog, I didn't realize I needed MatLab, not MatLab Compiler Runtime.
I received the error:
"Collecting matlab_kernal
Could not find a version that satisfies the requirement matlab_kernal (from versions: )
No matching distribution found for matlab_kernal"
As a work around, I found python code on GitHub that calculated the metric I wanted, but the author said I'd need to install 'MPI' from 'mpi4py'.
However, it seems my Terminal is now stuck on my previous installation attempts of 'matlab_kernal'. It lists my previous attempts to install these packages (see all white text above red error message in the attached screen capture).
I'm running: pip 18.1 from /anaconda3/lib/python3.7/site-packages/pip (python 3.7)
I've tried:
pip uninstall 'package'
Terminal restart
laptop restart
Screenshot of Terminal error
Please use:
pip install matlab-kernel
Try with conda as well:
conda install -c pchrapka matlab_kernel
I think you're making a typo with kernal.
I am on py3.7 with pip v19.3.
Output:
$ pip install matlab-kernel
Collecting matlab-kernel
Downloading https://files.pythonhosted.org/packages/64/ad/5f471160ec33e2f0f3586d285cd5e3b6dff51027849f28369d43d1d57fd1/matlab_kernel-0.16.7-py3-none-any.whl
Requirement already satisfied: jupyter-client>=4.4.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from matlab-kernel) (5.3.4)
Collecting metakernel>=0.23.0
Downloading https://files.pythonhosted.org/packages/ad/a9/0cd74cfbc9c4aeb117bdb7fd9ff12c3890be34ef5c77932e00ef4afaca98/metakernel-0.24.3-py2.py3-none-any.whl (208kB)
|████████████████████████████████| 215kB 246kB/s
Collecting wurlitzer>=1.0.2; platform_system != "Windows"
Downloading https://files.pythonhosted.org/packages/24/5e/f3bd8443bfdf96d2f5d10097d301076a9eb55637b7864e52d2d1a4d8c72a/wurlitzer-2.0.0-py2.py3-none-any.whl
Requirement already satisfied: ipython>=4.0.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from matlab-kernel) (7.8.0)
Requirement already satisfied: pyzmq>=13 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (18.1.0)
Requirement already satisfied: tornado>=4.1 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (6.0.3)
Requirement already satisfied: traitlets in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (4.3.3)
Requirement already satisfied: python-dateutil>=2.1 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (2.8.0)
Requirement already satisfied: jupyter-core>=4.6.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (4.6.0)
Requirement already satisfied: pexpect>=4.2 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from metakernel>=0.23.0->matlab-kernel) (4.7.0)
Collecting portalocker
Downloading https://files.pythonhosted.org/packages/91/db/7bc703c0760df726839e0699b7f78a4d8217fdc9c7fcb1b51b39c5a22a4e/portalocker-1.5.2-py2.py3-none-any.whl
Requirement already satisfied: ipykernel in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from metakernel>=0.23.0->matlab-kernel) (5.1.2)
Collecting ipyparallel
Downloading https://files.pythonhosted.org/packages/3f/82/aaa7a357845a98d4028f27c799f0d3bb2fe55fc1247c73dc712b4ae2344c/ipyparallel-6.2.4-py2.py3-none-any.whl (198kB)
|████████████████████████████████| 204kB 698kB/s
Requirement already satisfied: decorator in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (4.4.0)
Requirement already satisfied: setuptools>=18.5 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (39.0.1)
Requirement already satisfied: pickleshare in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.7.5)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (2.0.10)
Requirement already satisfied: jedi>=0.10 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.15.1)
Requirement already satisfied: pygments in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (2.4.2)
Requirement already satisfied: appnope; sys_platform == "darwin" in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.1.0)
Requirement already satisfied: backcall in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.1.0)
Requirement already satisfied: ipython-genutils in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from traitlets->jupyter-client>=4.4.0->matlab-kernel) (0.2.0)
Requirement already satisfied: six in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from traitlets->jupyter-client>=4.4.0->matlab-kernel) (1.12.0)
Requirement already satisfied: ptyprocess>=0.5 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from pexpect>=4.2->metakernel>=0.23.0->matlab-kernel) (0.6.0)
Requirement already satisfied: wcwidth in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=4.0.0->matlab-kernel) (0.1.7)
Requirement already satisfied: parso>=0.5.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jedi>=0.10->ipython>=4.0.0->matlab-kernel) (0.5.1)
Installing collected packages: portalocker, ipyparallel, metakernel, wurlitzer, matlab-kernel
Successfully installed ipyparallel-6.2.4 matlab-kernel-0.16.7 metakernel-0.24.3 portalocker-1.5.2 wurlitzer-2.0.0
WARNING: You are using pip version 19.3; however, version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
It's a version issue for pip and MacOS
See this thread
terminal error in MacOS from command 'pip install 'package-name':
"Collecting 'package-name'
Could not find a version that satisfies the requirement 'package-name' (from versions: )
No matching distribution found for 'package-name'"
Uninstall pip and reinstall pip in terminal

Installing twine fails because cannot uninstall 'pkginfo'

I need guidance on what I should do in this situation:
C:\Users\Dave\Desktop\2016Coding\testdist>pip install twine
Collecting twine
Using cached https://files.pythonhosted.org/packages/65/ae/9cfdff186dd4812c59bad890435538858f13fe43dbe6923e0fb20f0adfc8/twine-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: requests!=2.15,!=2.16,>=2.5.0 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from twine) (2.18.4)
Requirement already satisfied: requests-toolbelt>=0.8.0 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from twine) (0.8.0)
Collecting pkginfo>=1.4.2 (from twine)
Using cached https://files.pythonhosted.org/packages/a3/fe/f32a48d48f40a7209be9825fba2566cab92364787cf37de2e08300dd6ce7/pkginfo-1.4.2-py2.py3-none-any.whl
Requirement already satisfied: tqdm>=4.14 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from twine) (4.23.1)
Requirement already satisfied: setuptools>=0.7.0 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from twine) (38.5.1)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (1.22)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2018.1.18)
Requirement already satisfied: idna<2.7,>=2.5 in c:\users\dave\desktop\2016coding\environments\ipython_env\anaconda3\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2.6)
Installing collected packages: pkginfo, twine
Found existing installation: pkginfo 1.3.2
Cannot uninstall 'pkginfo'. 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.
I can't find another reference to this issue anywhere on the web.
pip install twine --ignore-installed

Categories