VPS-server was a version Python 2.6, I installed version Python 3.5.2.
When I try to install some packages with help pip, I got errors.
During installation packages:
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Versions:
# Python -V
# Python 3.5.2
# pip -V
# pip 8.1.2 from /usr/lib/python2.6/site-packages/pip-8.1.2-py2.6.egg (python 2.6)
# cat /etc/*-release
# CentOS release 6.8 (Final)
How to change path to pip from python 3.5 ?
if you haven't pip in server you can use get-pip file:
after install python usually installed pip and you can run by pip3 command
for example you can use:
pip3 install netaddr
Upgrading pip manually solved this issue for me once. Update pip Documentation
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org, but you'll need to upgrade pip.
On Linux or OS X:
pip install -U pip
On Windows [5]:
python -m pip install -U pip
Related
We have installed python 3.9 from external Link, my OS has in built python 3.6 and python3-pip for 3.6 version. If I install pip packages it will install for python 3.6 and it is not compatible for python 3.9. How to install pip3.9 ? so that i will install packages from pip3.9 command.
OS: Cent OS
I tried like this
python3.9 -m pip
python3.9: No module named pip
Some Python distributions may not come with pip installed. Try
python3.9 -m ensurepip
to install pip for your interpreter first.
Adding on #Selcuk 's answer, you can define which python version runs pip:
For example:
/path/to/python3.9/python -m pip install mypackage
This would install mypackage for the python version you referenced to.
Another suggestion is to use Conda, which handles different python versions pretty effectively.
I'm trying to install multiple python versions in linux, but asdf or pyenv get stuck with an error:
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
apt install libssl or apt install libssl1.0 didn't solved...
I already have version 2.7 and 3.8 by default.
Then I've stalled version 3.4 by downloading its source and building manually. If i try to create a virtual environment like python3.4 -m venv myenv, i can activate python --version shows the correct one:
$ python --version
Python 3.4.0
but pip still referenced to python 3.8:
(myenv)$ pip --version
pip 21.0.1 from ~/.local/lib/python3.8/site-packages/pip (python 3.8)
/usr/local/lib/python3.4/site-packages/ only has README file, and i can't figure out how to properly set this
I'm trying to install 'polyglot' using the below command
pip install polyglot
But I'm getting the below error
Command "python setup.py egg_info" failed with error code 1 in C:\Users\K~1.SHA\AppData\Local\Temp\pip-install-tcez0ptg\polyglot\
My python version is Python 3.6.4
Since I'm new to python I tried the below commands which I found online but they haven't helped
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
pip install --upgrade pip setuptools wheel
How can I install polyglot successfully? Any help on this is appreciated.
To install polyglot in Windows using a Python 3.6 or Python 3.7 you will need a wheel for two dependencies:
You need to download them and then install them with pip on your local machine.
Here you will find many unofficial python builds:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
install PyICU.whl
install PyCLD2.whl
In both cases you will need be able to choose the right version of the build for your windows version and your python version.
It's easy, for example for PyICU:
PyICU wraps the ICU (International Components for Unicode) library.
PyICU‑2.3.1‑cp27‑cp27m‑win32.whl
PyICU‑2.3.1‑cp27‑cp27m‑win_amd64.whl
PyICU‑2.3.1‑cp35‑cp35m‑win32.whl
PyICU‑2.3.1‑cp35‑cp35m‑win_amd64.whl
PyICU‑2.3.1‑cp36‑cp36m‑win32.whl
PyICU‑2.3.1‑cp36‑cp36m‑win_amd64.whl
PyICU‑2.3.1‑cp37‑cp37m‑win32.whl
PyICU‑2.3.1‑cp37‑cp37m‑win_amd64.whl
the 27 means Python 2.7 and the 36 Python 3.6...
If you have 64 bits python and windows then choose the amd64 otherwhise the win32 version.
Once you have download them you will need to install it using pip in your python environment:
In my case:
python -m pip install C:\Users\Administrator\Downloads\pycld2-0.31-cp37-cp37m-win_amd64.whl
python -m pip install C:\Users\Administrator\Downloads\PyICU-2.3.1-cp37-cp37m-win_amd64.whl
pip install git+https://github.com/aboSamoor/polyglot#master
I am on AWS Ec2 Amazon AMI. Trying to install virtualenv but PIP is set to use Python2.6
# pip -V && virtualenv --version
pip 9.0.1 from /usr/local/lib/python2.6/site-packages/pip-9.0.1-py2.6.egg (python 2.6)
bash: /usr/bin/virtualenv: No such file or directory
# python -V
Python 2.7.12
I tried uninstalling virtualenv and reinstalling it but no luck.
#pip install virtualenv
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Requirement already satisfied: virtualenv in /usr/local/lib/python2.6/site-packages
Here is the install directory:
# which pip
/usr/sbin/pip
# which python
/usr/bin/python
1.python2.7 -m pip install virtualenv
Reference Python official document
2.You can Install virtualenv for any python interpreter and use for a different python interpreter like:-
sudo pip3 install virtualenv
and then if you want to use python2.7 python interpreter then run following command to make virtualenv:-
virtualenv --python=/usr/bin/python2.7 virtualenv_name
NOTE :- python2.7 interpreter has to be present in /usr/bin/* folder
For more on above command see this answer
I'm working on mac OS X and I have both Python 2.7 and 3.3 on it. I want to install pykml module and i successfully installed it on python 3.3, but how do I do the same for Python 2.7?
You can do this if pip version >=1.5
$ pip2.6 install package
$ pip3.3 install package
if pip version is between 0.8 and 1.5 this will work
$ pip-2.7 install package
$ pip-3.3 install package