Generate Deps automatically. #123112
-
BodyI write some code in Python on my other account. How do I generate automatically all dependencies that code uses? I have a lot of packages installed because I need to experiment. Maybe some code scanner and knowledge base? Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hey there @GHuserE On Python, you can use the fallowing: pip3 freeze > requirements.txt This will list all installed packages into a file, including the precise version number. However, if you install a lot of other packages for other things, then this list may contain unnecessary elements. So, you should make sure that you use a virtual environment for development. Maybe consider doing your experiments in a seperate environment. Here is how you setup an environment: python3 -m venv location
source location/bin/activate Then, running If this helps you, consider marking it as the answer. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello @GHuserE
Good Luck! |
Beta Was this translation helpful? Give feedback.
Hey there @GHuserE
On Python, you can use the fallowing:
pip3 freeze > requirements.txt
This will list all installed packages into a file, including the precise version number. However, if you install a lot of other packages for other things, then this list may contain unnecessary elements. So, you should make sure that you use a virtual environment for development. Maybe consider doing your experiments in a seperate environment.
Here is how you setup an environment:
python3 -m venv location source location/bin/activate
Then, running
pip install <pck>
will install the package in a clean environment and you can avoidpip freeze
being polluted.If this helps you, consider marking it as the …