1

I installed some Python libraries in the Conda environment using the conda command. Again I installed some other packages/libraries e.g. stable-baselines using pip also in that Conda environment.

After that I exported environments in the requirements.txt file, using the command:

(conda_env) D:\userone> conda list --explicit>requirements.txt

After that, I opened and checked that file using VS Code. I found all packages/libraries which were installed using conda. But couldn't find the stable-baselines packages and others which were installed using pip.

I want to export those pip installed packages also in requirements.txt.

  • Maybe this could help: https://stackoverflow.com/questions/18640305/how-do-i-keep-track-of-pip-installed-packages-in-an-anaconda-conda-environment – nandevers Aug 16 '22 at 15:01
  • It would be nice if we could try and help the community by closing the question as answered! Have a good one! – nandevers Aug 16 '22 at 15:06
  • Before closing this question, I have a question. I got two answers also. Those answers are also working but different from the answer you suggested. I think those two answers are also helpful. Then should I close this question? (If "Yes", I will close. I am just asking) –  Aug 16 '22 at 15:13
  • @Isteak if you think that theese answers were helpful, but don't answered your question, you can just upvote them (and comments with helpful information too). If you think that one of the answers answered your question, you can mark it as answer and accept it. Don't forget to vote to help future searchers find important information. Read the [Why is voting important?](https://stackoverflow.com/help/why-vote) article. – vovakirdan Aug 17 '22 at 06:05
  • Thank you so much. I have understood. But my reputation is low to give upvote. I marked one answer as "Answer". When I will be able to upvote, I will upvote all of the helpful answers. –  Aug 18 '22 at 03:14

2 Answers2

1

I think it will works

pip3 freeze > C:\PATH\TO\FOLDER\requirements.txt

It may be needed to run terminal as administrator - if you cannot I recommend just write 'pip3 freeze' and copy output to the proper file.

0
pip freeze > requirements.txt

And to install all packeges:

pip install -r requirements.txt
vovakirdan
  • 345
  • 3
  • 11