Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to freeze directly installed packages without their dependencies #9165

Closed
DarkSuniuM opened this issue Nov 26, 2020 · 3 comments
Closed

Comments

@DarkSuniuM
Copy link

DarkSuniuM commented Nov 26, 2020

What's the problem this feature will solve?
Get a list of packages I installed directly and they havn't installed as dependency.

For example:

$ pip install flask
#...
Installing collected packages: itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, flask
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 flask-1.1.2 itsdangerous-1.1.0

Installing Flask, made multiple dependencies of flask, installed, Perfect.

$ pip freeze
click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1

but there is no way for me to only get the Flask package in my pip freeze command which I installed directly by myself.

Describe the solution you'd like
Having a flag like --intentionally or even having this behavior as default and a flag for getting dependencies as well would be awesome, I'll explain why.

Additional context
This can be a huge help on #5823, Even if #5823 gets implemented, still, people using pip freeze > requirements.txt will list all dependencies, and when someone does a pip install -r requirements.txt, All packages, including the dependencies listed in requirements.txt, will be installed as top-level by their own.

@DarkSuniuM
Copy link
Author

Ops,
Seems like it's a duplicate of #6344

@Kushagratandon12
Copy link

Kushagratandon12 commented Nov 26, 2020

Hi DarkSuniuM, I recommend you using a new virtual environment every time you create a new project.
Reason
a) When you pip install ---- python install that dependencies for your complete python in your system. But when you will use a virtual environment and then you will install the dependencies and pip freeze it will show only that you have only used for that project. Then pip freeze will use only the dependencies that you have used for your specific project.

https://realpython.com/python-virtual-environments-a-primer/ for more info.

@DarkSuniuM
Copy link
Author

DarkSuniuM commented Nov 28, 2020

Hi DarkSuniuM, I recommend you using a new virtual environment every time you create a new project.
Reason
a) When you pip install ---- python install that dependencies for your complete python in your system. But when you will use a virtual environment and then you will install the dependencies and pip freeze it will show only that you have only used for that project. Then pip freeze will use only the dependencies that you have used for your specific project.

https://realpython.com/python-virtual-environments-a-primer/ for more info.

Hi there

Which part of this topic made you think I'm using same env or global site-libs for all of my projects? xD

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants