requirement for "pip install git+[git repo]"? [duplicate] - python

This question already has answers here:
Configuring so that pip install can work from github
(8 answers)
Closed 5 years ago.
Does anyone know if it is required that a Python repository has setup.py script in root directory in order for pip install git+[git repo] to work? How does pip find dependent packages from the source code?
Thanks!

Yes. Dependent packages are looked up via said setup.py (setup_requires and install_requires).

Related

Why python didn't see nltk module? [duplicate]

This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 4 months ago.
I cant run my programm because nltk module is missing but i just intstalled it and it just right here in the folder
I tried to reinstall my python, and tried to change python interpreter but nothing worked
How have you actually installed nltk?
You can check if it's actually installed with pip freeze.
What might be happening here is that you could have another version of python installed, so make sure that you actually call the same interpreter for checking and installing with pip, in your case E:/pythonProject1/Scripts/python.exe -m pip freeze and E:/pythonProject1/Scripts/python.exe -m pip install nltk

Error trying to install matplotlib in Windows [duplicate]

This question already has answers here:
Cannot install Matplotlib on Python 3.10
(2 answers)
Closed 1 year ago.
I'm trying to install matplotlib for Python 3.10 in Windows. Im using pip: pip install matplotlib I've already installed NumPy, Cython, Pillow and other libraries needed. But it shows this error:
error: Failed to download any of the following: ['http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz']. Please download one of these urls and extract it into 'build/' at the top-level of the source repository.
I've downloaded the said library and copied it in .cache/matplotlib/build but it doesnt work.
Any idea?
So as #FlyingTeller commented, there are no stable realeses of matplotlib so using --pre fixed the problem.

How can I get a list of packages pip command will install without DOWNLOADING or INSTALLING the packages? [duplicate]

This question already has answers here:
Is there a way to list pip dependencies/requirements?
(10 answers)
How to list dependencies for a python library without installing? [duplicate]
(3 answers)
List Python packages that will be installed from requirements.txt
(2 answers)
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Let's say I have a setup.cfg (or setup.py) file with all the packages listed.
Now, if I run pip install . it'll install all packages and it's dependencies listed in install_requires. Is there a way to only get the list of packages and dependencies without downloading or installing them, like in a requirements.txt format?
This command I'm looking for ideally would also work for pip install '.[tests]', which would list packages defined for tests under extras_require in setup.cfg.
What this question is NOT asking:
I'm not asking for pip freeze or pip list type of command which lists all the packages installed in an environment. Rather I want the same type of list, just not of the packages already installed but of the packages that will be installed by the defined configuration in setup.cfg.
I'm not asking about how to generate this list by downloading these packages either, but only to collect them. I don't see why pip would need to download these packages when what I need is only the list of the packages and dependencies with their versions.
SOLUTION
stackoverflow marked this question as a duplicate which it is NOT. I have found a solution however because this question is closed I won't be able to submit it as an answer, but will post it here in the question instead.
To generate requirements.txt for packages listed in install_requires in your setup.cfg or setup.py, you would need to install pip-tools.
pip install pip-tools
pip-compile
To generate a requirements.txt file that includes packages specified under extras_requires for tests and dev:
pip-compile --extra tests --extra devrequirements.txt file with packages listed under

Is it possible to move pip packages from one python version to another? [duplicate]

This question already has answers here:
How to install python packages from older version to newer version?
(2 answers)
Copy installed packages using pip to another environment
(1 answer)
Closed 2 years ago.
I have been using python 3.8 for quite some time , but now I want to use python 3.9. The problem is that I have a lot of packages installed in the 3.8 folder. Is it possible to "move" all these packages to the 3.9 folder? Or can anyone suggest me a better way to deal with this issue?
You can make a requirements .txt file by:
pip freeze > requirements.txt
and after installing python 3.9 type(in the same directory in which you made the requirements.txt):
pip install -r my_packages.txt
As shown in this post

how can I get installed python packages in code [duplicate]

This question already has answers here:
How to retrieve pip requirements (freeze) within Python?
(4 answers)
Closed 2 years ago.
Is there any way to get list of installed python packages in the environment?
I tried executing pip command in code but is there any api for interacting with packages?
>>> import os
>>> os.system("pip freeze")
Type help("modules") in the Python shell. That will print out all the modules you have installed on your computer.

Categories

Resources