Upgrade a module after a pull request merged - python

I am new to Github this question may sound very silly. Recently I reported a bug of pandas in Python to their Github page. One guy opened a pull request to fix that bug. The bug was fixed and the pull request was merged.
I am not sure now how I can upgrade pandas with the new change. I tried
pip3 install --upgrade pandas
and
conda update pandas
but the bug is still there when I run my code in Python. Really appreciate if someone can tell me how to upgrade the module properly after a pull request is merged

The versions of pandas available from conda and pip are those that are marked as releases. To get the latest code that has not been released yet, you would have to build it yourself from source in this case.
For pandas, the instructions to do this are given here.

pip install [-U] pandas
installs packages from PyPI.
conda update pandas
installs from Anaconda.
The pull-request obviously is not yet included in a release. You can wait for the next release.
To install directly from Github ask pip to install using git:
pip install -U 'git+https://github.com/pandas-dev/pandas.git#egg=pandas'
But please bear in mind you're required to install git, a compiler and a lot of development tools (pandas is written in C/C++ and have to be compiled).

Related

Unable to run or reinstall or update yfinance

I have been using the package yfinance to retrieve stock prices for some time. Recently, as noted in several online posts, the package stopped working due to an update to the package. I thought that this would be a simple process to update the package and fix the problem. This has not been the case.
I am using Anaconda so I want to update using conda instead of pip using PowerShell on a PC.
What I have tried so far unsuccessfully
$ conda update --all
$ conda update conda
$ conda update-c ranaroussi yfinance
None of these worked. I tried to uninstall and then reinstall Anaconda then reinstall yfinance. Yes, I agree that this seemed like overkill for what should have been a simple issue. Unfortuntaelty, now I can't even install the package. I am using the conda command that I originally used to install the package
$ conda install -c ranaroussi yfinance
, which comes from the developer's page.
https://anaconda.org/ranaroussi/yfinance
Now, I try to run this I receive an error message that the package cannot be found in my current channels.
Screenshot of error msg.
At this point, I am just spinning my wheels and would appreciate some help. I hope that someone who might have experienced a similar issue has a suggestion for how to resolve this problem.
Thanks
Even though it's hosted on anaconda.org, this package doesn't appear to be a conda package. Its page only lists PyPI source and a one-liner to install with pip; i.e. compare it to a typical conda package. Probably best here to just pip install yfinance into a conda environment.

gspread package not updated on pip or conda

I'm trying to use get_worksheet_by_id function from the gspread package.
I can see the function is available in https://github.com/burnash/gspread/blob/master/gspread/models.py
It's also listed in documentation.
But I it's missing in pip and conda repositories. As a result I'm not able to use it.
https://pypi.org/project/gspread/#files
https://anaconda.org/conda-forge/gspread/files
Not sure where to report it.
As you can see if you look at the blame, the function was only added by this commit, which is from march 2021. The latest version available from pypi and conda-forge is however from february. That is why you don't have if when you install through these channels.
Some suggestions:
You could simply edit the code of the library in your site-packages
Install from the github sources, either by cloning the repo and doing python setup.py install or through python -m pip install git+https://github.com/burnash/gspread
Create an issue on the github repo and ask that the version on conda-forge/pypi is updated to include this feature.

Keeping a private python package installed and up to date

Question regarding installation of a Python-package from a private git-repository.
I have an init.py-file that is run whenever a user logs in to my service. This script is responsible for installing required packages, amongst others a python-package (with setup.py) from a private repository.
I am looking for ways to:
Install the latest version of the package if not currently installed.
Update the package, if the current installed version is not the latest.
Perform no action, if the latest version of the package already is installed.
I have tried the following:
Using pip install --upgrade git+ssh://..., however this always performs a clean install of the package.
Using pip install git+ssh://..., however this will not update the package if the current version is not the latest.
I am currently looking into ways of doing this manually by:
Git cloning the repository if it does not exist locally; then,
Call python setup.py develop to install the package in develop mode; then finally,
Do a git stash; git pull to discard any changes to working directory, and automatically pull latest changes.
However, I feel this approach is prone to users messing up.
I'd love if someone could provide some insight into this issue.
Thanks in advance!

Who updates pip package versions?

I was having problems with one package not doing what I read in it's documentation, until I noticed that pip installed a outdated version.
On the pip package page it would seem like it was last update 2014, but when I installed, the package files were versioned mid 2013.
How does updating pip packages work and who should be doing it? The project maintainer (on github, or on pip pages?)?
All packages that can be downloaded with PIP are actually hosted on the Python Package Index. The Python organization collaborates with project maintainers to host the projects.
The problem with having outdated packages on pip that do not align with the documentation and current state on github can be really annoying. Despite that you did not ask for a workaround I would like to contribute one in case that other users might land on this page looking for such.
First uninstall the package you installed via pip before:
pip uninstall package
Next install the latest version directly from the github repo:
pip install git+https://github.com/user/package.git
The cool thing about this is that you can still manage your packages with pip but your not limited by what version is available on the Python Package Index.

Installing SOAP for Python

I am new to Python, trying to learn it by doing a tutorial based on "Dive into Python" book.
I am already in chapter about SOAP and I encountered some problems, when I tried to install all required libraries to use SOAP.
The tutorial says I need 3 libraries:
PyXML, fpconst, SOAPpy
I've installed fpconst succesfully.
However I can't install two others. I read on some forum that to install SOAPpy I need to have PyXML already installed, so maybe the problem is only in the first library.
I followed instructions in README, but I'm getting some error and I don't really know what is wrong and how can solve it. See screen for details. My version of Python is 2.7.2+ and I am trying to install PyXML version 0.8.4.
Full size
The errors states that such file or directory does not exist.
I am using Ubuntu 11.10.
PS: Ah! I forgot to mention that. I downloaded PyXML from this source :
http://sourceforge.net/projects/pyxml/
And it it written here that it is out of date and one shouldn't use it. So what is an alternative to PyXML?
If you are using Ubuntu, why not just install these with your package manager?
sudo apt-get install python-lxml python-fpconst python-soappy
The package manager should be your preferred way to install any software in a Linux distro - it will make your life a lot easier, and ensure you keep things up-to-date and can easily uninstall them.
Failing that, you could also use PyPi - the Python Package Index.
pip install lxml
pip install fpconst
pip install soappy

Categories

Resources