install tar.gz with pip at requirements.txt - python

i want to install electrum-ltc into my app like this:
but if i include this line in my requirements.txt the role-out fails and i have to install it manually with the same line shown above.
if i install it like this at the requirements.txt:
some modules do not get installed in that specific case its the script package.
thanks in advance

I don't know if you can accept it as answer because I "cheated" in a way.
I did:
$ mkdir /tmp/tgz-install && cd /tmp/tgz-install
$ pipenv install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz\#egg\=electrum\[fast\]
$ pipenv shell
$ pip3 freeze > requirements.txt
$ cat requirements.txt
I got:
aiohttp==3.5.4
aiohttp-socks==0.2.2
aiorpcX==0.10.4
async-timeout==3.0.1
attrs==18.2.0
certifi==2018.11.29
chardet==3.0.4
dnspython==1.16.0
ecdsa==0.13
Electrum==3.3.3
idna==2.8
jsonrpclib-pelix==0.4.0
multidict==4.5.2
protobuf==3.6.1
pyaes==1.6.1
pycryptodomex==3.7.3
QDarkStyle==2.5.4
qrcode==6.1
six==1.12.0
yarl==1.3.0
I suppose you can do everything with just pip.
In case you can't use pipenv directly - you can use created requirements.
Inform in case you have some trouble.

Related

Downloading requirements.txt from GitHub

I trying to download requirements.txt from my repo in GitHub
I use pip install -e git+https://github.com/GabrielCoutz/Problema-Chiado#egg=requirements.txt and this is returning:
ERROR: File "setup.py" not found for legacy project requirements.txt from git+https://github.com/GabrielCoutz/Problema-Chiado#egg=requirements.txt.
How i can create setup.py and what i have to put in?
pip install -r https://raw.githubusercontent.com/GabrielCoutz/Problema-Chiado/main/requirements.txt
-e is for local installs for developing, for example. Check this:
What is the use case for `pip install -e`?

Pip3 is unable to install requirements.txt during docker build

I am using docker tutorial (https://docs.docker.com/language/python/build-images/) to build a simple python app. Using freeze command I made requirements.txt file which consists a lot of packages.
When I want to build the docker image, I am getting this error:
Step 4/6 : RUN pip3 install -r requirements.txt ---> Running in
f92acd21d271
ERROR: Could not find a version that satisfies the requirement
apt-clone==0.2.1 (from versions: none)
ERROR: No matching distribution found for apt-clone==0.2.1
The command '/bin/sh -c pip3 install -r requirements.txt' returned a
non-zero code: 1
This is my dockerfile contents (same as what is mentioned in the tutorial):
# syntax=docker/dockerfile:1
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD [ "python3", "-m", "flask","run","--host=0.0.0.0" ]
It's not related to apt-clone==0.2.1 package. Whatever I try to install in the docker image, it fails. I tried apt update and installing pip3 in the dockerfile too but didn't work.
What did I miss?
pip3 freeze outputs the package and its version installed in the current environment, no matter the package installed by pip or with other methods.
In fact, apt-clone==0.2.1 comes from debian package repo, not from pypi.org, see next:
$ pip3 freeze | grep apt-clone
$ apt-get install -y apt-clone
$ dpkg -l apt-clone
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii apt-clone 0.4.1 all Script to create state bundles
$ dpkg -L apt-clone
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/apt-clone
/usr/share/doc/apt-clone/copyright
/usr/share/doc/apt-clone/changelog.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/apt-clone.8.gz
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/apt_clone.py
/usr/lib/python3/dist-packages/apt_clone-0.2.1.egg-info
/usr/bin
/usr/bin/apt-clone
$ pip3 freeze | grep apt-clone
apt-clone==0.2.1
You could see from above, the apt_clone.py & apt_clone-0.2.1.egg-info are installed by debian package apt-clone, the 0.4.1 is just the debian package version, while 0.2.1 is the python package version.
So, for apt-clone similar, you need to install them with apt although they are seen in pip3 freeze.
There is no package named apt-clone in the public PyPI repository, so pip3 obviously cannot find it.
If you actually have a Python package named like this, where did it come from?
If you created a package with this name locally, you need to install it too in your Docker image somehow.
If you are inside an organization, maybe you have a local PyPI with different packages than the public one, and then you need to configure pip3 to use it (try pip3 -i http://your.local.pypi/simple -r requirements.txt where obviously the URL needs to be something else, but we can't guess what).
If pip3 freeze says you have this package, it must have come from somewhere, but we don't know where. You have to figure that out, or supply more details to help us help you.
There is a Debian package named apt-clone but that obviously isn't something pip can install. Did you actually mean apt-get install -y apt-clone==0.2.1? (I can only find version 0.4.1 in Debian Buster, though.)
... #atline's answer explains what happened (you should probably accept that) but the simple fix is to manually populate requirements.txt with your actual requirements. pip3 freeze is a nice shorthand for that if you are in a virtual environment, but it's not a proper replacement for a manually curated requirements.txt or setup.py (or its modern replacements, currently moving from setup.cfg to pyproject.toml). If flask is the only package your app needs, simply put pip3 install flask and don't create a requirements.txt.

python pip trouble installing from requirements.txt

I've had great luck with pip in the past, but working at installing some stuff in a venv on is giving me some headaches.
I keep getting errors like
No distributions at all found for somepackage Storing debug log for failure in /root/.pip/pip.log
Could not find any downloads that satisfy the requirement somepackage
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-RjqjFW/psycopg2
I know these packages are installed on the main system, but its like they won't work on the venv. How do you all get around this problem? It's been a long day and I just don't understand what the problem is, especially because they work on my local system, they work on the main python install on my remote system, but not in the venv for some crazy reason. Any ideas?
Here is the requirements, I thought it was alittle intense for django, but thats what pip freeze > requirements.txt gave me
Babel==1.3
Django==1.7.1
Fabric==1.10.1
Flask==0.10.1
Flask-Babel==0.9
Flask-Login==0.2.11
Flask-Mail==0.9.1
Flask-OpenID==1.2.4
Flask-SQLAlchemy==2.0
Flask-WTF==0.10.3
Flask-WhooshAlchemy==0.56
Jinja2==2.7.3
MarkupSafe==0.23
PAM==0.4.2
Pillow==2.3.0
Pygments==1.6
Scrapy==0.24.4
Sphinx==1.2.2
Tempita==0.5.2
WTForms==2.0.1
Werkzeug==0.9.6
Whoosh==2.6.0
adium-theme-ubuntu==0.3.4
apt-xapian-index==0.45
argparse==1.2.1
backports.ssl-match-hostname==3.4.0.2
blinker==1.3
boto==2.20.1
bottle==0.12.7
certifi==14.05.14
chardet==2.0.1
colorama==0.2.5
command-not-found==0.3
coverage==3.7.1
cssselect==0.9.1
debtagshw==0.1
decorator==3.4.0
defer==1.0.6
dirspec==13.10
docutils==0.11
duplicity==0.6.23
ecdsa==0.11
flipflop==1.0
guess-language==0.2
guppy==0.1.9
html5lib==0.999
httplib2==0.8
ipython==2.3.1
itsdangerous==0.24
lockfile==0.8
lxml==3.3.3
nose==1.3.4
numpy==1.8.2
oauthlib==0.6.1
oneconf==0.3.7
paramiko==1.15.2
pbr==0.10.7
pexpect==3.1
piston-mini-client==0.7.5
psycopg2==2.5.4
pyOpenSSL==0.13
pyasn1==0.1.7
pycrypto==2.6.1
pycups==1.9.66
pycurl==7.19.3
pygame==1.9.1release
pygobject==3.12.0
pyserial==2.6
pysmbc==1.0.14.1
python-apt==0.9.3.5ubuntu1
python-debian==0.1.21-nmu2ubuntu2
python-openid==2.2.5
pytz==2014.10
pyxdg==0.25
queuelib==1.2.2
reportlab==3.0
requests==2.2.1
roman==2.0.0
sessioninstaller==0.0.0
simplegeneric==0.8.1
six==1.5.2
software-center-aptd-plugins==0.0.0
speaklater==1.3
sqlalchemy-migrate==0.9.2
sqlparse==0.1.14
system-service==0.1.6
tornado==4.0.2
unity-lens-photos==1.0
urllib3==1.7.1
virtualenv==1.11.6
w3lib==1.10.0
wsgiref==0.1.2
wxPython==2.8.12.1
wxPython-common==2.8.12.1
xdiagnose==3.6.3build2
z3c.xmlhttp==0.5.1
zope.interface==4.0.5
zope.publisher==4.0.0a4
zope.traversing==4.0.0
zope.viewlet==4.0.0a1
Had a similar issue but the above method didn't work for me. Clarified it with a rather simpler solution:
(venv) $ pip install --upgrade -r requirements.txt
UPDATE:
This command upgrades all packages that have been explicitly listed in your requirements.txt file.
Your requirements.txt file is just a list of pip install arguments placed in a file. They are used to hold the result from pip freeze for the purpose of achieving repeatable installations. In this case, your requirements.txt file contains a pinned version of everything that was installed when pip freeze was run.
try pip install -r requirements.txt
It worked for me
I see a few problems:
Your requirements.txt is for the base system Python, not any virtual environment. Django does not have any external dependencies.
You are using the root user to install packages in your virtual environment (or you are using sudo when you shouldn't).
The best option is to start from scratch:
$ virtualenv myvenv
...
$ source myvenv/bin/activate
(myvenv) $ pip install django
...
(myvenv) $ pip freeze > requirements.txt
sudo pip install -r requirements.txt or pip install -r requirements.txt worked for me
I had this problem but with a different cause - I had an old version of virtualenv. Before version 1.7 you had to specify the option --no-site-packages when you create the virtual environment to not include global packages.
Two options to fix this, either upgrade your virtualenv:
sudo pip install virtualenv --upgrade
virtualenv venv
Or use the old one with the no-site-packages option:
virtualenv venv --no-site-packages
That fixed my requirements.txt file.
Following solution has worked for me :
(my-virtualenv) 20:42 ~/MyPf (master)$ pip freeze > requirements.txt |
(my-virtualenv) 20:43 ~/MyPf (master)$ pip install -r requirements.txt
You have the same problem that I stack with, So the solution is easy:
You must check the file path the text takes from it like in a blue circle.
Run code below:
cd C:\Users\yk406.anaconda\yolov7
Note: path directory is an example paste the path that your environment works in
when the first step is done the second one is done by installing file text like in a green circle.
Run code below:
pip install -r requirements.txt

pip - installation of sub-dependencies overrides other packages on requirements.txt

my requirements file is like that :
https://github.com/sontek/pyramid_webassets/archive/38b0b9f9f4e36dc22b3a5c10eabf4d9228d97740.zip#egg=pyramid_webassets-0.0
https://github.com/miracle2k/webassets/archive/334d55c6bcfd091cb2d984777daf943acde0d364.zip#egg=webassets-0.8.dev
when running pip install -r requirements.txt I want it to install the specific version of pyramid_webassets, and then the specific webassets version (0.8.dev)
the problem is that pyramid_webassets have the webassets as sub-dependency, and it installs the latest of this package.
so the output of pip freeze is
Chameleon==2.14
Mako==0.9.1
MarkupSafe==0.18
PasteDeploy==1.5.2
WebOb==1.3.1
argparse==1.2.1
pyramid==1.4.5
pyramid-webassets==0.0
repoze.lru==0.6
translationstring==1.1
venusian==1.0a8
webassets==0.9
wsgiref==0.1.2
zope.deprecation==4.1.0
zope.interface==4.0.5
you might notice that webassets version is the latest (0.9) though I specified the version I want (0.8.dev).
I tried to reorder the list, adding the --upgrade flag- nothing helped.
any idea how can I install it and still having the required version of webassets?
Thanks.
soultion:
I found this commend useful:
cat requirements.txt | xargs -L1 pip install
that will install one by one the packages orderly
but we should add --upgrade for the last package so it'll upgrade it.
use pip install option to not install package dependencies
$ pip install --no-deps -r requirements.txt
Doing a pip freeze afterwards
gottfried#sascha-Latitude-XT2:~/venv$ bin/pip freeze
argparse==1.2.1
pyramid-webassets==0.0
webassets==0.8.dev
wsgiref==0.1.2
References
pip cookbook - Ensuring repeatability
What happens when you move webassets higher then pyramid_webassets on the list?

Python Django requirements.txt

I have a requirements.txt file containing all my dependencies but it is not processed correctly :
After a pip install -r requirements.txt, I get the following pip freeze :
argparse==1.2.1
wsgiref==0.1.2
But when I do a pip install of :
numpy==1.6.2
Django==1.4.2
django-tastypie==0.9.14
pyes==0.19.1
And then run my pip install -r requirements.txt . Then it works.
Here is what my requirements.txt contains :
numpy==1.6.2
Django==1.4.2
django-tastypie==0.9.14
urllib3==1.5
pyes==0.19.1
BeautifulSoup==3.2.1
MySQL-python==1.2.3
IMAPClient==0.9.1
Jinja2==2.6
Pillow==2.0.0
amqp==1.0.9
anyjson==0.3.3
billiard==2.7.3.22
celery==3.0.16
django-celery==3.0.11
django-compressor==1.3
django-concurrency
django-extensions==1.1.1
https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack
django-model-utils==1.2.0
django-multiforloop==0.2.1
django-social-auth==0.7.22
html5lib==0.95
httplib2==0.8
kombu==2.5.7
logilab-astng==0.24.2
logilab-common==0.59.0
oauth2==1.5.211
ordereddict==1.1
pycrypto==2.6
pylint==0.27.0
python-dateutil==1.5
python-openid==2.2.5
pytz==2013b
six==1.3.0
unittest2==0.5.1
wsgiref==0.1.2
xlrd==0.9.0
xmltodict==0.4.6
django-storages>=1.1.8
boto==2.8.0
lxml==3.1.0
pyelasticsearch==0.4.1
django-tastypie-elasticsearch==0.1.0
Would anyone have a solution ?
I tried this out and the problem is with django-tastypie-elasticsearch. There is a known issue, whereby installation with pip fails if Django hasn't been installed yet. Here is the issue report:
https://github.com/llonchj/django-tastypie-elasticsearch/issues/1
Looks like django-tastypie-elastic has only two contributors, so you're probably on your own. The good news is that it wasn't your fault!
On mac:
To get your already installed dependencies
pip3 freeze > requirements.txt
from: Automatically create requirements.txt
Then if you want to install them, and you are using a virtual environment
pip3 install -r requirements.txt
from:
How can I install packages using pip according to the requirements.txt file from a local directory?
If you want to update them
I just know how to do it with pip-review.
https://pypi.org/project/pip-review/#description
pip3 install pip-review or pip install pip-review
then pip-review --local --auto
from:
How to upgrade all Python packages with pip
The "https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack" line is not a valid pip requirement. It should read "-e git+https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack"

Categories