How do I upgrade from a previous version of websauna? - pyramid

I have a websauna project which I created using this command:
pip install -e "git+https://github.com/websauna/websauna.git#master#egg=websauna[celery,utils,notebook]"
this is found in the documentation at: https://websauna.org/docs/tutorials/gettingstarted/tutorial_02.html
This is the development version on github, and I recall it was alpha4. How do I upgrade this to the latest version(presumably at alpha5 as of this writing)?

If you want to install the latest release from the PyPi do:
pip uninstall websauna
pip install -U "websauna[celery,utils,notebook]"
If you want to follow the latest Github master branch:
pip uninstall websauna
pip install e "git+https://github.com/websauna/websauna.git#master#egg=websauna[celery,utils,notebook]"
Uninstall step might or might not be required depending on if you are switching between pip PyPi package install and pip -e.

Related

Installing or updating a package using the pip in Python

If I accidentally run any of the following commands to install or update a package using pip in Python 3.x twice, will it install or update that package twice on the machine?
pip install <package_name>
pip install --upgrade <package_name>
After updating a package twice, it says that:
Requirement already satisfied: appnope in ./.pyenv/versions/3.11.0/lib/python3.11/site-packages (from ipykernel) (0.1.3)"
Does this mean I already updated or installed the package?
Yes, it means you have already installed or upgraded.
The first command installs the package. Because you have not specified a package version with something like pip install package-name==1.0.0, pip will install the package with the latest version.
The second command attempts to upgrade the same package. Because it is installed with the latest version, there is nothing to upgrade. pip will not reinstall packages unless you ask it to.
pip install --upgrade --force-reinstall <package-name>
pip will also attempt to install dependencies for your packages that may be required for the package you requested.
Requirement already satisfied: appnope in ./.pyenv/versions/3.11.0/lib/python3.11/site-packages (from ipykernel) (0.1.3)"

Pip: force installation of package version from a git repo

I am facing the problem to install a package based on a specific commit hash from Github.
This works great if the used venv does not already contain the installed package:
pip install --upgrade git+https://github.com/user/pyckagexyz.git#1234567890032ab36c732dc32d9c257d401e71b0
This installs pyckagexyz and it's dependencies if it does not yet exist in the used venv. If it already exists this command does nothing. I also tried without success
pip install --upgrade --no-cache-dir git+https://github.com/user/pyckagexyz.git#1234567890032ab36c732dc32d9c257d401e71b0
=> No effect
pip install --upgrade --force git+https://github.com/user/pyckagexyz.git#1234567890032ab36c732dc32d9c257d401e71b0
=> Installation fails because on of the dependencies can't be installed.
The only workaround I have found so far is to uninstall the package before re-installing it or to first install the package without dependencies and force --no-deps --force and then again a second time without force and dependencies to make sure all dependencies are present.
Is there no other way to say pip to install the selected version of a packet and overwrite an installed version?
Have you tried the --force-reinstall option with pip install?
pip install --force-reinstall git+https://github.com/user/pyckagexyz.git#1234567890032ab36c732dc32d9c257d401e71b0
From the pip docs:
--force-reinstall
Reinstall all packages even if they are already up-to-date.

How do you check currently downloaded version and download latest version of SymPy?

I am currently using a windows computer and installed SymPy with pip install SymPy.
You can use pip list to show the names and versions of all currently installed packages. pip list --outdated will also show outdated packages including their version and the latest version available. To upgrade to the latest version of a package, use pip install --upgrade <package name>. To get more information on pip and the available commands view the pip documentation.

WARNING: pyjwt 1.1.0 does not provide the extra 'crypto'

I am getting the error
WARNING: pyjwt 1.1.0 does not provide the extra 'crypto'
for Docker command
RUN pip install --no-cache /wheels/*
while installing PyJWT==1.7.1, Is there any solution to fix this warning?
PyJWT 1.7.1 was released at Dec 7, 2018.
Extra crypto was added to PyJWT on Oct 22, 2019 hence it's available in PyJWT 2.0+.
To use pyjwt[crypto] you need to install later version. Currently the latest is PyJWT 2.0.1.
You can install pyjwt with the cryptographic Dependency with:
pip install pyjwt[crypto]
As seen in pyjwt's documentation
You can also separately install the required library with as seen on pyca/cryptography's documentation:
pip install cryptography
In order to fix the following warning
WARNING: You are using pip version 20.1.1; however, version 21.0 is
available. You should consider upgrading via the
'/usr/local/bin/python -m pip install --upgrade pip' command.
I added the following code to Dockerfile
# upgrade pip
RUN pip install --upgrade pip
I just reverted adding this and it now works correctly, although I still have the pip version warning.

Install python package from GitHub into Anaconda on Linux Ubuntu

I need to install this package located on GitHub into Anaconda enviroment. How can I achieve this?
You can install the latest version from github with pip using
pip install https://github.com/<user-name>/<repo-name>/tarball/<branch-name>
in your case this would be:
pip install https://github.com/lucjon/Py-StackExchange/tarball/master

Resources