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.
Related
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!
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).
I noticed on this page https://anaconda.org/pypi/urllib3 that the pip command to install the package was slightly different than normal:
pip install -i https://pypi.anaconda.org/pypi/simple urllib3
Digging a bit through pip's help I figured out the following which basically says that things are usually installed from https://pypi.python.org/simple.
Why is there a separate Python repository that Anaconda uses? I would've expected that you simply pip install anything but this seems to suggest there is a level of choice between the following two.
https://pypi.python.org/simple
https://pypi.anaconda.org/pypi/simple
Package Index Options (including deprecated options):
-i, --index-url Base URL of Python Package Index (default
https://pypi.python.org/simple). This should point to a
repository compliant with PEP 503 (the simple
repository API) or a local directory laid out in the
same format.
Why is there a separate Python repository that Anaconda uses?
Because Continuum IO (the maintainers of conda and Anaconda) decided that they wanted to have their own pip repository, I suppose. As far as I know, there's no difference between the two, except that possibly some package versions are different between the two repositories, or perhaps one repository has some packages that aren't present in the other.
In any case, in my experience, the pip that's installed by default with Anaconda searches the https://pypi.python.org/simple repository by default, and one has to manually include the -i option to get to the Anaconda pip repository.
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.
I am trying to find a way to use my Github repo tags for versioning of my package, which should be available for download using something like pip.
The problem is every time I update the package version I have to upload the contents to pypi.
Is there any way to just set the donwload url in pypi point to my github repo, So that when I do something like
pip install -I MySQL_python==1.2.2 and it just install that form the git tag 1.2.2, without me having to upload the version to pypi.
EDIT:(I was not clear enough)
I know about the pip install git+git://blabal way
I am looking for something like I tell pypi that my package is at github.com/bla.git
and the user does pip install bla==1.2 and pip install that from github (with version as tag)
Something like vundle for vim
You could install like this:
pip install -e git+<repo address>#<ref>#egg=<egg name>
where ref could be a commit id, tag name or branch name.
Read the docs.