I am a package maintainer and have a library on pip - Django-spaghetti-and-meatballs.
Its at version 0.2.0
It is listed on pip as version 0.2.0
setup.py imports some code that clearly states it is version 0.2.0
But when users try to run pip install django-spaghetti-and-meatballs==0.2.0 they (and I) get:
legostormtroopr:~/workspace $ pip install django-spaghetti-and-meatballs==0.2.0
Downloading/unpacking django-spaghetti-and-meatballs==0.2.0
Could not find a version that satisfies the requirement django-spaghetti-and-meatballs==0.2.0 (from versions: 0.1.0, 0.1.0rc5, 0.1.1)
Cleaning up...
No distributions matching the version for django-spaghetti-and-meatballs==0.2.0
Storing debug log for failure in /home/ubuntu/.pip/pip.log
What have I done wrong?
PS. It feels a little spammy to link to the library and such, but its a problem and I felt it better to point to the problem directly.
By looking at the list at: https://pypi.python.org/simple/django-spaghetti-and-meatballs/ you could see that the wheel had not been uploaded.
Running:
python setup.py bdist_wheel upload
will rebuild the wheel and upload it.
Related
Trying to pip install a repo's specific branch. Google tells me to
pip install https://github.com/user/repo.git#branch
The branch's name is issue/34/oscar-0.6 so I did pip install https://github.com/tangentlabs/django-oscar-paypal.git#/issue/34/oscar-0.6 but its returning a 404.
How do I install this branch?
Prepend the url prefix git+ (See VCS Support):
pip install git+https://github.com/tangentlabs/django-oscar-paypal.git#issue/34/oscar-0.6
And specify the branch name without the leading /.
Using pip with git+ to clone a repository can be extremely slow (test with https://github.com/django/django#stable/1.6.x for example, it will take a few minutes). The fastest thing I've found, which works with GitHub and BitBucket, is:
pip install https://github.com/user/repository/archive/branch.zip
which becomes for Django master:
pip install https://github.com/django/django/archive/master.zip
for Django stable/1.7.x:
pip install https://github.com/django/django/archive/stable/1.7.x.zip
With BitBucket it's about the same predictable pattern:
pip install https://bitbucket.org/izi/django-admin-tools/get/default.zip
Here, the master branch is generally named default.
This will make your requirements.txt installing much faster.
Some other answers mention variations required when placing the package to be installed into your requirements.txt. Note that with this archive syntax, the leading -e and trailing #egg=blah-blah are not required, and you can just simply paste the URL, so your requirements.txt looks like:
https://github.com/user/repository/archive/branch.zip
Instructions to install from private repo using ssh credentials:
$ pip install git+ssh://git#github.com/myuser/foo.git#my_version
To install a package from a subdirectory, say stackoverflow
$ pip install git+ssh://git#github.com/myuser/foo.git#my_version#subdirectory=stackoverflow
https://pip.pypa.io/en/stable/topics/vcs-support/
Just to add an extra, if you want to install it in your pip file it can be added like this:
-e git+https://github.com/tangentlabs/django-oscar-paypal.git#issue/34/oscar-0.6#egg=django-oscar-paypal
It will be saved as an egg though.
This worked like charm:
pip3 install git+https://github.com/deepak1725/fabric8-analytics-worker.git#develop
Where :
develop: Branch
fabric8-analytics-worker.git : Repo
deepak1725: user
You used the egg files install procedure.
This procedure supports installing over git, git+http, git+https, git+ssh, git+git and git+file. Some of these are mentioned in other answers.
It's good. You can use branches, tags, or hashes to install.
Steve_K noted it can be slow to install with "git+" and proposed installing via zip file:
pip install https://github.com/user/repository/archive/branch.zip
Alternatively, I suggest you may install using the .whl file if this exists.
pip install https://github.com/user/repository/archive/branch.whl
It's pretty new format, newer than egg files. It requires wheel and setuptools>=0.8 packages. You can find more in the documentation.
to me your suggestion from question work e.g.
pip install https://github.com/user/repo.git#branch
translating concretely to doing
pip install -U git+https://github.com/moskomule/anatome.git#dev
worked. Perhaps remove the extra / is redundant. My output:
(original_anatome_env) brando~/ultimate-anatome ❯ pip install -U git+https://github.com/moskomule/anatome.git#dev
Collecting git+https://github.com/moskomule/anatome.git#dev
Cloning https://github.com/moskomule/anatome.git (to revision dev) to /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2
Running command git clone -q https://github.com/moskomule/anatome.git /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2
Running command git checkout -b dev --track origin/dev
Switched to a new branch 'dev'
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Resolved https://github.com/moskomule/anatome.git to commit 4b576e51cb1824a57ea04974e0f92b5a6143294d
Requirement already satisfied: torch>=1.10.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (1.10.0)
Requirement already satisfied: torchvision>=0.11.1 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (0.11.1)
Requirement already satisfied: typing-extensions in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torch>=1.10.0->anatome==0.0.6) (3.10.0.2)
Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (8.4.0)
Requirement already satisfied: numpy in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (1.21.4)
Building wheels for collected packages: anatome
Building wheel for anatome (setup.py) ... done
Created wheel for anatome: filename=anatome-0.0.6-py3-none-any.whl size=10167 sha256=63b12a36f33deb8313bfe7756be60bd08915b8ba36711be47e292b590df70f61
Stored in directory: /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-ephem-wheel-cache-rde_ngug/wheels/19/e4/be/01479e8cba62ae8cdcd501cd3bf49e199f2bb94732a6a1b006
Successfully built anatome
Installing collected packages: anatome
Attempting uninstall: anatome
Found existing installation: anatome 0.0.5
Uninstalling anatome-0.0.5:
Successfully uninstalled anatome-0.0.5
Successfully installed anatome-0.0.6
0.6.0 is the dev branch version number and 0.5.0 is the master, so it worked!
For windows & pycharm setup:
If you are using pycharm and If you want to use pip3 install git+https://github.com/...
firstly, you should download git from https://git-scm.com/downloads
then restart pycharm
and you can use pycharm terminal to install what you want
If I've installed a python package using both conda and pip then when I call a function from that package, will I be using the version from conda or from pip?
My situation is as follows: I'm trying to use the from_estimator method released in scikit-learn version 1.0. this past September. However, my current version of scikit-learn was version 0.24.2 so I decided to update the package. I previously had installed conda, but never actually used it to update/install a package; instead I always used pip. This time I decided to try to install scikit-learn version 1.0 with conda. However, when I wrote conda install scikit-learn=1.0 in terminal, I got the error
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- scikit-learn=1.0
Frustrated, I decided to simply install scikit-learn version 1.0 with pip by typing pip install -U scikit-learn in terminal. This gave me the message
Requirement already satisfied: scikit-learn in /home/eturok/anaconda3/lib/python3.7/site-packages (0.24.2)
Collecting scikit-learn
Downloading scikit_learn-1.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (23.1 MB)
|████████████████████████████████| 23.1 MB 17.2 MB/s
Requirement already satisfied: joblib>=0.11 in /home/eturok/anaconda3/lib/python3.7/site-packages (from scikit-learn) (1.0.1)
Requirement already satisfied: scipy>=1.1.0 in /home/eturok/anaconda3/lib/python3.7/site-packages (from scikit-learn) (1.7.1)
Requirement already satisfied: numpy>=1.14.6 in /home/eturok/anaconda3/lib/python3.7/site-packages (from scikit-learn) (1.20.3)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/eturok/anaconda3/lib/python3.7/site-packages (from scikit-learn) (2.2.0)
Installing collected packages: scikit-learn
Attempting uninstall: scikit-learn
Found existing installation: scikit-learn 0.24.2
Uninstalling scikit-learn-0.24.2:
Successfully uninstalled scikit-learn-0.24.2
Successfully installed scikit-learn-1.0
Now typing pip list and conda list in terminal returns scikit-learn 1.0 and scikit-learn 1.0 pypi_0 pypi respectively.
My questions are:
If I only updated scikit-learn with pip, why is scikit-learn also updated with conda?
Why at the beginning was I unable to update scikit-learn with conda? This version of scikit-learn was released pretty recently. Is it possible that conda hasn't yet gotten around to supporting the new release of scikit-learn yet?
In general, how does conda decide which packages to support?
If I've installed a python package using both conda and pip then when I call a function from that package, will I be using the version from conda or from pip?
Not a conda expert, but since no one is bothering to answer:
I don't think it was. You got an error and installation was aborted. Might it be that conda list just sees the pip installed package and reports it as comming from pypi?
Yes, conda default repo for scikit-learn does not have 1.0 yet, 0.24 is the last (see here: https://anaconda.org/anaconda/scikit-learn). The conda-forge repo for scikit learn does have 1.0 (see here: https://anaconda.org/conda-forge/scikit-learn)
I don't know how packages move from conda-forge to conda. Probably you should always use conda forge as in conda install -c conda-forge scikit-learn. Or, even better, always use pip.
No idea, don't do it :) Always use either conda or venv virtual environments and in such cases burn them with fire and start anew.
I am trying to install flair. It is throwing below error when executing below command:
pip install flair
ERROR: Packages installed from PyPI cannot depend on packages which are not also hosted on PyPI.
tiny-tokenizer depends on SudachiDict_core# https://object-storage.tyo2.conoha.io/v1/nc_2520839e1f9641b08211a5c85243124a/sudachi/SudachiDict_core-20190927.tar.gz
I thought installing this package explicitly might fix the error but it doesn't. The error remains same.
The installed version of SudachiDict-core is below:
SudachiDict-core 0.0.0
Below is the Environment:
OS: Windows 10
Python: 3.6 (64 bit)
Any hint is appreciated. Thank you!
Note:
First hurdle when installing flair was torch package. It was resolved simply when torch package is installed. The error looked like below:
ERROR: Could not find a version that satisfies the requirement torch>=1.1.0 (from flair) (from verERROR: No matching distribution found for torch>=1.1.0 (from flair)
You can try
pip install --upgrade git+https://github.com/zalandoresearch/flair.git
Source: https://github.com/flairNLP/flair/issues/1327#issuecomment-571639994
Or
to install separately:
pip install tiny-tokenizer
After this run:
pip install flair
It is strange running below command solved the problem.
pip install flair==0.4.3
I assume that the problem is in a latest version 0.4.4 (and its dependencies).
Note: I had torch==1.1.0 package already installed.
I have few dependencies in a project listed in the requirements.txt file,
requests==2.18.4
secrets==1.0.2
PyYAML==3.12
I wanted to installed them and called the command inside the virtualenv,
$ pip install -r bin/requirements.txt
I get the message provided below,
Collecting requests==2.18.4 (from -r bin/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Could not find a version that satisfies the requirement secrets==1.0.2 (from -r bin/requirements.txt (line 2)) (from versions: )
No matching distribution found for secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Inside the virtualenv, I can have the versions provided,
$ python -V
Python 3.7.2
$ pip -V
pip 19.0.3 from /Users/chaklader/PycharmProjects/Welance-Craft/env/lib/python3.7/site-packages/pip (python 3.7)
Whats the issue here?
Update
I had to delete the secrets and update the other dependencies:
requests==2.21.0
PyYAML==3.13
While there is a secrets package, it’s very old (2012), has only one release, a broken website, and no info. It doesn’t appear to install on Python 2.7 or 3.7.
You may instead be trying to use the secrets standard library that’s built-in to Python 3.6+. It’s not a package, so you don’t need to install it or add it to your requirements.txt, simply import secrets. If you need it for an earlier version, there does appear to be an unofficial backport.
When trying to install the package myself, I get the same error.
However, when searching this package on pypi.org, it seems that the last released version was in 2012 and the link there to the project's homepage leads to an almost completely empty webpage. I would thus assume that this package doesn't exist anymore.
Now there is a backport of the secrets module for Python 2.7, 3.4 and 3.5 by the name of python2-secrets. (the name is a bit confusing in my opinion)
Installation:
pip install --user python2-secrets
I got the same issue recently(2022) and solved this with
pip install python-secrets
see documentation in https://pypi.org/project/python-secrets/
Trying to pip install a repo's specific branch. Google tells me to
pip install https://github.com/user/repo.git#branch
The branch's name is issue/34/oscar-0.6 so I did pip install https://github.com/tangentlabs/django-oscar-paypal.git#/issue/34/oscar-0.6 but its returning a 404.
How do I install this branch?
Prepend the url prefix git+ (See VCS Support):
pip install git+https://github.com/tangentlabs/django-oscar-paypal.git#issue/34/oscar-0.6
And specify the branch name without the leading /.
Using pip with git+ to clone a repository can be extremely slow (test with https://github.com/django/django#stable/1.6.x for example, it will take a few minutes). The fastest thing I've found, which works with GitHub and BitBucket, is:
pip install https://github.com/user/repository/archive/branch.zip
which becomes for Django master:
pip install https://github.com/django/django/archive/master.zip
for Django stable/1.7.x:
pip install https://github.com/django/django/archive/stable/1.7.x.zip
With BitBucket it's about the same predictable pattern:
pip install https://bitbucket.org/izi/django-admin-tools/get/default.zip
Here, the master branch is generally named default.
This will make your requirements.txt installing much faster.
Some other answers mention variations required when placing the package to be installed into your requirements.txt. Note that with this archive syntax, the leading -e and trailing #egg=blah-blah are not required, and you can just simply paste the URL, so your requirements.txt looks like:
https://github.com/user/repository/archive/branch.zip
Instructions to install from private repo using ssh credentials:
$ pip install git+ssh://git#github.com/myuser/foo.git#my_version
To install a package from a subdirectory, say stackoverflow
$ pip install git+ssh://git#github.com/myuser/foo.git#my_version#subdirectory=stackoverflow
https://pip.pypa.io/en/stable/topics/vcs-support/
Just to add an extra, if you want to install it in your pip file it can be added like this:
-e git+https://github.com/tangentlabs/django-oscar-paypal.git#issue/34/oscar-0.6#egg=django-oscar-paypal
It will be saved as an egg though.
This worked like charm:
pip3 install git+https://github.com/deepak1725/fabric8-analytics-worker.git#develop
Where :
develop: Branch
fabric8-analytics-worker.git : Repo
deepak1725: user
You used the egg files install procedure.
This procedure supports installing over git, git+http, git+https, git+ssh, git+git and git+file. Some of these are mentioned in other answers.
It's good. You can use branches, tags, or hashes to install.
Steve_K noted it can be slow to install with "git+" and proposed installing via zip file:
pip install https://github.com/user/repository/archive/branch.zip
Alternatively, I suggest you may install using the .whl file if this exists.
pip install https://github.com/user/repository/archive/branch.whl
It's pretty new format, newer than egg files. It requires wheel and setuptools>=0.8 packages. You can find more in the documentation.
to me your suggestion from question work e.g.
pip install https://github.com/user/repo.git#branch
translating concretely to doing
pip install -U git+https://github.com/moskomule/anatome.git#dev
worked. Perhaps remove the extra / is redundant. My output:
(original_anatome_env) brando~/ultimate-anatome ❯ pip install -U git+https://github.com/moskomule/anatome.git#dev
Collecting git+https://github.com/moskomule/anatome.git#dev
Cloning https://github.com/moskomule/anatome.git (to revision dev) to /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2
Running command git clone -q https://github.com/moskomule/anatome.git /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2
Running command git checkout -b dev --track origin/dev
Switched to a new branch 'dev'
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Resolved https://github.com/moskomule/anatome.git to commit 4b576e51cb1824a57ea04974e0f92b5a6143294d
Requirement already satisfied: torch>=1.10.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (1.10.0)
Requirement already satisfied: torchvision>=0.11.1 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (0.11.1)
Requirement already satisfied: typing-extensions in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torch>=1.10.0->anatome==0.0.6) (3.10.0.2)
Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (8.4.0)
Requirement already satisfied: numpy in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (1.21.4)
Building wheels for collected packages: anatome
Building wheel for anatome (setup.py) ... done
Created wheel for anatome: filename=anatome-0.0.6-py3-none-any.whl size=10167 sha256=63b12a36f33deb8313bfe7756be60bd08915b8ba36711be47e292b590df70f61
Stored in directory: /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-ephem-wheel-cache-rde_ngug/wheels/19/e4/be/01479e8cba62ae8cdcd501cd3bf49e199f2bb94732a6a1b006
Successfully built anatome
Installing collected packages: anatome
Attempting uninstall: anatome
Found existing installation: anatome 0.0.5
Uninstalling anatome-0.0.5:
Successfully uninstalled anatome-0.0.5
Successfully installed anatome-0.0.6
0.6.0 is the dev branch version number and 0.5.0 is the master, so it worked!
For windows & pycharm setup:
If you are using pycharm and If you want to use pip3 install git+https://github.com/...
firstly, you should download git from https://git-scm.com/downloads
then restart pycharm
and you can use pycharm terminal to install what you want