I only have python files which require some packages to be installed. I have conda installe on my computer as well. I just have the code, the project is not running anywhere at the moment. I checked this question, however as far as I understand an assumption of this solution is that you run the export command from running environment. I don't have the environment, only the code which has import statements inside. Is there a way to automatically install all packages needed?
Asked
Active
Viewed 407 times
0
-
Does this link help? https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html – Thomas Apr 12 '20 at 11:33
-
I have conda installed. I see no other information regarding my problem. – Borut Flis Apr 12 '20 at 11:40
-
1Have you tried creating an enviroment? `conda create --name your_env_name python=3.7 -y` – Thomas Apr 12 '20 at 11:46
-
And also https://docs.anaconda.com/anaconda/user-guide/tasks/install-packages/ for installing conda packages – Thomas Apr 12 '20 at 11:47
-
1You should specify your dependencies in a `requirements.txt` or `env.yaml` file for pip or conda respectively. – Alex Apr 12 '20 at 12:04
-
@Alex, do you know if there is a way to create the .yaml code just out of python code? – Borut Flis Apr 12 '20 at 12:08
-
@BorutFlis there is [yolk](https://pypi.org/project/yolk/) or [snakefood](http://furius.ca/snakefood/) though I have never used these. Here are some related questions: https://stackoverflow.com/questions/35796968/get-all-modules-packages-used-by-a-python-project and https://stackoverflow.com/a/509194/3279716 – Alex Apr 12 '20 at 12:21
-
Does this answer your question? [Get all modules/packages used by a python project](https://stackoverflow.com/questions/35796968/get-all-modules-packages-used-by-a-python-project) – merv Apr 14 '20 at 02:19