Why I can't pip install nltk on mac os? - macos

I'm using mac os mojave, install python 2.7 and install pip using python get-pip.py, I already try those command to install pip :
pip install --upgrade pip
pip install nltk
and try
sudo python -m pip install --upgrade nltk
But also result to same error like in this image
Or here in text:
error in nltk setup command: 'install_requires' must be a string or
list of strings containing valid project/version requirement
specifiers; Expected version spec in singledispatch; python_version <
"3.4" at ; python_version < "3.4"
Is it because my python version (2.7) ? But in pip ntlk page it says also support 2.7
update:
pip install nltk success after running :
pip install --upgrade setuptools pip --user

Start with upgrading installation tools:
pip install --upgrade setuptools pip

Related

SyntaxError when pip install pip ( def read(rel_path: str))

when using pip I get the following warning:
$ pip install pip
Requirement already satisfied (use --upgrade to upgrade): pip in /usr/lib/python2.7/site-packages
You are using pip version 8.1.2, however version 22.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
So I follow the suggestion, but I get a SyntaxError:
$ pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/99/bb/696e256f4f445809f25efd4e4ce42ff99664dc089cafa1e097d5fec7fc33/pip-22.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-k03IN1/pip/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-k03IN1/pip/
You are using pip version 8.1.2, however version 22.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
My default pip is not the one I want to be:
$ ~/anaconda3/bin/pip --version
pip 22.1 from /home/mdi0316/.local/lib/python3.8/site-packages/pip (python 3.8)
$ ~/anaconda3/bin/pip3 --version
pip 22.1 from /home/mdi0316/.local/lib/python3.8/site-packages/pip (python 3.8)
$ which pip
/usr/bin/pip
$ pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
$ echo $PATH
/home/mdi0316/bin:/home/mdi0316/anaconda3/envs/nagare_env/bin:/home/mdi0316/anaconda3/condabin:/home/mdi0316/anaconda3/envs/nagare_env/bin:/cm/shared/apps/TURBOMOLE/bin/em64t-unknown-linux-gnu_smp:/cm/shared/apps/TURBOMOLE/scripts:/cm/local/apps/cuda/libs/current/bin:/cm/shared/apps/cuda11.1/sdk/11.1.1/bin/x86_64/linux/release:/cm/shared/apps/cuda11.1/toolkit/11.1.1/bin:/cm/shared/apps/python3.8.7/bin:/cm/shared/apps/openmpi/gcc/64/4.0.5/bin:/cm/local/apps/gcc/8.2.0/bin:/cm/shared/apps/slurm/18.08.9/sbin:/cm/shared/apps/slurm/18.08.9/bin:/cm/local/apps/environment-modules/4.2.1/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/4.2.1/bin
I am within a personally created anaconda environment (nagare_env).
Yet, the default pip in in ~/usr
I also tried to install pip through pip3, but I could solve this neither way.
$ pip3 install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in ./.local/lib/python3.8/site-packages (22.1)
$ pip3 install --upgrade --trusted-host pypi.org --trusted-host files.pythonhosted.org pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in ./.local/lib/python3.8/site-packages (22.1)
any hint?
Thanks
Marco
I faced the same issue on my centos. Guess my pip file was corrupted. I installed it again and was working fine.
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
pip install --upgrade setuptools
"pip 21.0, in January 2021, removed Python 2 support, per pip’s Python 2 support policy.
you should change your pip version
from: https://pypi.org/project/pip/

How do you upgrade version of pip on Repl.it?

I'm having issues upgrading pip using the pip3 install --upgrade pip3 command on Repl.it and getting this error:
Repl.it: Installing fresh packages
Usage: pip3 [options]
pip3: error: no such option: --upgrade
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Repl.it: package installation failed!
How can I upgrade pip on Repl.it?

Python 3.5: Error installing Beautifulsoup library

I'm trying to install Beautifulsoup library from python 3.5 following the next steps:
Upgrade pip: python -m pip install --upgrade pip
Install setuptools python -m pip install -U pip setuptools
Install Beautifulsoup python -m pip install beautifulsoup
My operating system is Windows 10, 64 bit. And the result that I've got is this error:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\JOSCAR~1\AppData\Local\Temp\pip-build-dgi2w24s\beautifulsoup\
Screenshot:
What am I doing wrong?
I have found the solution to my problem. I was trying to install it using this command:
python -m pip install beautifulsoup
And this is not correct. To install it correctly the comand is ...
python -m pip install beautifulsoup4

pip not updating to newest version

When I run pip install -U pip it doesn't install the newer version.
drahcir#Altair:~/dev$ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
drahcir#Altair:~/dev$ pip install -U pip
Downloading/unpacking pip
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Successfully installed pip
Cleaning up...
drahcir#Altair:~/dev$ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
Even though it says it downloaded pip 8.1.2, the pip version still says 1.5.6
How can I get pip to upgrade to 8.1.2?

Install jmespth-term in Mac OSx

I am unable to install jmespath-term
It gives me :
>> sudo pip install jmespath-term
Collecting jmespath-term
Could not find any downloads that satisfy the requirement jmespath-term
No distributions at all found for jmespath-term
Python Version
python --version
Python 2.7.5
Pip Version
pip --version
pip 6.0.3 from /Library/Python/2.7/site-packages/pip-6.0.3-py2.7.egg (python 2.7)
jmespath-term appears to have an alternate name in the pypi index:
Doing a search with pip (pip search jmespath-term) returns:
jmespath-terminal - JMESPath Terminal
So pip install jmespath-terminal should work for you.

Resources