I have a server with CentOS installed on it. Python 2.6.6 was installed on it. I installed python 3.4.2 and 2.7.8. Now when i use command like :
pip install virtualenvwrapper
it's stop with error and error is for using different packages. How can i remove other packages and have just python 3.4.2?
Sorry for my terrible English.
If you want to uninstall a package through pip, you can try
pip uninstall <package>
More details can be found here
Related
I have installed python 3.9 in Ubuntu, because it comes with python 3.8 which is an older version.
I changed the command for terminal alias python 3 = python 3.9, but when I installed pip, it installed for python 3.8 and after that when I am using pip install to install python packages, it installs for python 3.8. How can I fix it?
try with pip3 install
This kind of issue even happened to my case when I was working with the python modules recently on my project. Try this out it worked for me.
Due to variations in the installation process of python, pip often requires different ways to access for different people. A few examples that may help you include pip3 install, py pip install py -3 pip install or python3 pip install. Usually one of these works for me.
Today I faced a problem regarding pip3 in Ubuntu. Ubuntu comes with python 3.8 but I wanted to use latest versions of python, like 3.9 or maybe 3.10. So I installed it using 'ppa:deadsnakes' repository and also installed pip. But the problem is I want to use pip in python 3.9 instead of version 3.8. So I changed the default python version to 3.9 and everything crashed.
So reverted to python 3.8. Whenever I install some package it gets installed using python 3.8.
Help me, how can I use python 3.9 pip and install packages in python 3.9 without changing the default version.
Any help is appreciated.
--> Thing I want is that when I want to install python package using
pip3 install <package_name> it must install in python3.9 and not in python3.8
You don't need to install pip separately
You should be able to refer to it as such
python3.9 -m pip install
Hello everyone I fixed my issue.
The problem is we cannot override default python version in Ubuntu as so many things depend on it.
So I just made an alias as : alias pip3='python3.9 -m pip' and alias for python : alias python3='/usr/bin/python3.9'
If anyone face this issue please do what I specify and you will be good to go.
Now all my packages are being installed in python3.9.
Currently all python3 versions are using the same pip version which can be installed by:
sudo apt-get install python3-pip
The easiest way to work with a specific python version is creating a virtualenv and working under it. When working with a virtualenv you can use pip freely without worrying about which python version it belongs.
you can use pip for python3.9 by pip3.9 install <package-name>
I'm having problems while installing a new package in Python. I was looking for the termcolor package. I installed it using the apt:
sudo apt-get install python-termcolor
But when I try to use it in Python 3.6 it keep telling me that's not installed. I checked whether it was and I got:
cris#Manaos:~$ dpkg -L python-termcolor
/.
/usr
/usr/share
/usr/share/pyshared
/usr/share/pyshared/termcolor-1.1.0.egg-info
/usr/share/pyshared/termcolor.py
/usr/share/doc
/usr/share/doc/python-termcolor
/usr/share/doc/python-termcolor/README.rst
/usr/share/doc/python-termcolor/copyright
/usr/share/doc/python-termcolor/changelog.Debian.gz
/usr/share/doc/python-termcolor/CHANGES.rst
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/termcolor-1.1.0.egg-info
/usr/lib/python2.7/dist-packages/termcolor.py
So I understand that the package was correctly installed, but in the v2.7. How do I get it installed in the v3.6?
EDIT: I've read that if a use the pip installer, I could assign in which version of Python I'd like it installed, like using pip3 to install the package in 3.XX. But I tried it, it says that it was correctly installed and when I open Python 3.6 and try to use it, still got the ModuleNotFoundError.
EDIT2: After checking one more time, I discovered that with pip3 I installed the termcolor package in Python 3.5.3, but how can I get it installed in Python 3.6.1?
You need to specify you want the python 3 version.
sudo apt-get install python3-termcolor
I have Python installed in Windows and used pip to install lots of things.
How can I know what packages I installed with pip?
pip list will list all your installed packages.
I am using RedHat Linux.
Python 2.6 is already installed in usr/src/bin. When I install Python 2.7, it gets installed in usr/local/src/bin.
Further, I need to install sklearn. When I try installing sklearn using pip, it refers to Python2.6 and not Python2.7.
You can run python -m pip to see if pip is using the right version of python
I think you can probably specify the location with usr/local/src/bin pip install If you're sure that's where python 2.7 is installed. If pip is not using python 2.7 you should reinstall pip in the correct version.
There is another question which could help solve yours:
Pip Install not installing into correct directory?