How do I upgrade azureml-sdk such that the newest release of azureml-core, 1.1.5.5, is installed?
If azureml-sdk is not installed, pip install --upgrade azureml-sdk will install azureml-core==1.1.5.5. If it is already installed, then it won't.
$ pip list --format=freeze | grep 'azureml-core'`
> azureml-core==1.1.5.1
$ pip install --upgrade azureml-sdk[interpret,notebooks]
$ pip list --format=freeze | grep 'azureml-core'`
> azureml-core==1.1.5.1
You can use the eager strategy to force an upgrade of requirements:
pip install -U --upgrade-strategy eager azureml-sdk
run pip install --upgrade azureml-core==1.1.5.5.
azureml-sdk's metadata.json (as of 1.1.5.1) lists the following requirements:
azureml-core (==1.1.5.*)
azureml-dataprep[fuse] (==1.3.2)
azureml-pipeline (==1.1.5.*)
azureml-train (==1.1.5.*)
azureml-train-automl-client (==1.1.5.*)
So if the SDK version 1.1.5.1 was already installed, then azureml-core==1.1.5.1 meets the SDK's requirements and it won't be upgraded.
Related
I am trying to install some pip packages on an Ubuntu 18.4 (For python3) I see if pip is even installed
>/home/me/pip3
Command 'pip3' not found, but can be installed with:
sudo apt install python3-pip
So I do that and I get this:
>/home/me/sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (9.0.1-2.3~ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
I try whereis for pip:
>/home/me/whereis pip
pip: /usr/local/bin/pip /usr/local/bin/pip2.7 /opt/jython2.7.0/bin/pip /opt/jython2.7.0/bin/pip2.7
and for pip3:
>/home/me/whereis pip3
pip3: /usr/share/man/man1/pip3.1.gz
Why do I have the man pages for it? This makes no sense to me. Any Ideas?
UPDATE
In answer to the first 3 comments
#Mad Physicist Yes it's in my path, and version get's me:
pip 19.0.3 from /home/me/.local/lib/python3.6/site-packages/pip (python 3.6)
Why is it there?
#KuboMD I get this:
>/home/me/python -m pip install xyz
Collecting xyz
Could not find a version that satisfies the requirement xyz (from versions: )
No matching distribution found for xyz
#amitr I get this:
>/home/me/which pip
/usr/local/bin/pip
but that one in my usr/local/bin
From you pip --version output, I assume you have made some upgrades to pip, probably using pip install --upgrade pip --user command, because 19.0.3 is the version you get when upgrading pip via pip. On Ubuntu, both pip2 and pip3 have package version 9.0.1 as you can see here:
https://packages.ubuntu.com/bionic/python3-pip
https://packages.ubuntu.com/bionic/python-pip
It appears that location of your pip is /home/me/.local/lib/python3.6/site-packages/pip. This is where python programs/modules end up, when they are installed via pip install --user option. From that --version output, you can see that your current default pip is actually pip3 because version outputs that it's for (python 3.6), i.e. pip that installs packages for python3.6.
Try listing what other pip binaries you have in your /home/me/.local/bin with command:
ls /home/me/.local/bin/pip*
You should see pip3 and probably pip3.6 there as well.
If there is pip3 executable there a solution would be adding /home/me/.local/ to you PATH environment variable, so that pip3 is callable directly from your shell.
When I try to install anything with (for example) python3 -m pip install numpy , I get
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
I've tried upgrading pip3 with python3 -m pip install --upgrade pip but have only gotten
Requirement already up-to-date: pip in
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-
packages
and when I do python3 -m pip --version I get
pip 7.1.2 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
I'm unable to install any modules at all. Any advice? I am on MacOS.
To solve your problem, I suggest you use brew as the package manager and install python, not as binary from the python.org but binary using brew (https://brew.sh), I hope it'll fix your troubles, during the installation process.
Install brew package manager:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install "python3" on your machine (python2 can be installed in the same way):
$ brew install python3
Check what version of python you are using:
$ which python3
Output(should look like): /usr/local/bin/python3
Check what pip you are using:
$ which pip3
Output(should look like): /usr/local/bin/pip3
Then you can install any package using "pip":
$ pip3 install virtualenv
Verify that package was installed:
$ pip3 freeze | grep virtualenv
Update pip manually, first download pip:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
and then run the command
python3 get-pip.py
Now you can install with pip3
pip3 install numpy
What is the way to update a package using pip?
those do not work:
pip update
pip upgrade
I know this is a simple question but it is needed as it is not so easy to find (pip documentation doesn't pop up and other questions from stack overflow are relevant but are not exactly about that)
The way is
pip install <package_name> --upgrade
or in short
pip install <package_name> -U
Using sudo will ask to enter your root password to confirm the action, but although common, is considered unsafe.
If you do not have a root password (if you are not the admin) you should probably work with virtualenv.
You can also use the user flag to install it on this user only.
pip install <package_name> --upgrade --user
For a non-specific package and a more general solution, you can check out pip-review. A tool that checks what packages could/should be updated.
To install:
$ pip install pip-review
Then run:
$ pip-review --interactive
requests==0.14.0 is available (you have 0.13.2)
Upgrade now? [Y]es, [N]o, [A]ll, [Q]uit y
Use this code in terminal:
python -m pip install --upgrade PACKAGE_NAME
For example I want update pip package:
python -m pip install --upgrade pip
More examples:
python -m pip install --upgrade selenium
python -m pip install --upgrade requests
...
tl;dr script to update all installed packages
If you only want to upgrade one package, refer to #borgr's answer. I often find it necessary, or at least pleasing, to upgrade all my packages at once. Currently, pip doesn't natively support that action, but with sh scripting it is simple enough. You use pip list, awk (or cut and tail), and command substitution. My normal one-liner is:
for i in $(pip list -o | awk 'NR > 2 {print $1}'); do sudo pip install -U $i; done
This will ask for the root password. If you do not have access to that, the --user option of pip or virtualenv may be something to look into.
I use the following line to update all of my outdated packages:
pip list --outdated --format=freeze | awk -F '==' '{print $1}' | xargs -n1 pip install -U
import subprocess as sbp
import pip
pkgs = eval(str(sbp.run("pip3 list -o --format=json", shell=True,
stdout=sbp.PIPE).stdout, encoding='utf-8'))
for pkg in pkgs:
sbp.run("pip3 install --upgrade " + pkg['name'], shell=True)
Save as xx.py
Then run Python3 xx.py
Environment: python3.5+ pip10.0+
While off-topic, one may reach this question wishing to update pip itself (See here).
To upgrade pip for Python3.4+, you must use pip3 as follows:
sudo pip3 install pip --upgrade
This will upgrade pip located at: /usr/local/lib/python3.X/dist-packages
Otherwise, to upgrade pip for Python2.7, you would use pip as follows:
sudo pip install pip --upgrade
This will upgrade pip located at: /usr/local/lib/python2.7/dist-packages
Also, in Jupyter notebook, by running the code below in a code cell, you can update your package:
%pip install <package_name> --upgrade
Execute the below command in your command prompt,
C:\Users\Owner\AppData\Local\Programs\Python\Python310>python -m pip install --upgrade pip
Output will be like below,
Requirement already satisfied: pip in c:\users\owner\appdata\local\programs\python\python310\lib\site-packages (21.2.4)
Collecting pip
Downloading pip-22.0.3-py3-none-any.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 3.3 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.2.4
Uninstalling pip-21.2.4:
Successfully uninstalled pip-21.2.4
Successfully installed pip-22.0.3
Im trying to install google assistant on my Raspberry Pi, but when I keep getting an error: pip is a package and cannot be directly executed
Instead of
pip [...]
Try doing
python -m pip [...]
Can't really help more without more info.
I think your version of pip is old. You need to upgrade it first, like this:
pip install -U pip
You may need to upgrade setuptools too:
pip install -U setuptools
Since google-assistant-library is available as a wheel, you need to install wheel too:
pip install wheel
I don't know if you can do that with Raspberry Pi, but I recommend you to used a virtualenv. That way, you have a fresh and isolated Python executable and a recent version of pip.
virtualenv your_proj
source your_proj/bin/activate
pip install wheel
pip install google-assistant-library
For newer version ie. using pip3:
pip3 install -U <<package name>>
I had the same problem.
I think it was an outcome of a failed
> .\python.exe -m pip install --upgrade pip
do to some environment misconfiguration.
So it first removed the existing version 10.0.1, and then the installation of the new version 22.3.1 failed, leaving me with no pip.
From official documentation, I ran
> .\python.exe -m ensurepip --upgrade
which restored the original pip 10.0.1.
Then I fixed the environment problem, and then again
> .\python.exe -m pip install --upgrade pip
I now have pip 22.3.1.
I'm running Red Hat Enterprise Linux (on AWS). Whenever I use pip, it warns me that my pip is out of date and that I need to upgrade it by doing pip install --upgrade pip.
But when I do that it seemingly has no effect and simply tells me the same thing. It's circular!
How can I fix this? See below
$ pip install --upgrade pip
You are using pip version 6.0.8, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: pip in my-virtualenv/lib/python2.7/site-packages
Since the aforementioned pip install --upgrade pip` doesn't seem to work, I just tried uninstalling and reinstalling python-pip. When I did that it tells me it will install pip 6.1.1.-1.21.amzn1. How can I make it install the newer version??
$ sudo yum install python-pip
Loaded plugins: priorities, update-motd, upgrade-helper
5 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package python26-pip.noarch 0:6.1.1-1.21.amzn1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
python26-pip noarch 6.1.1-1.21.amzn1 amzn-main 1.9 M
Transaction Summary
===========================================================================================================================================================
Install 1 Package
Total download size: 1.9 M
Installed size: 6.4 M
Is this ok [y/d/N]:
Can you just download pip 8.1.1 from github then install it from commandline?
$ wget https://github.com/pypa/pip/archive/8.1.1.zip
$ unzip 8.1.1.zip
$ cd pip-8.1.1/
$ python setup.py install