Skip to content

Commit

Permalink
Update README.md with new instructirons
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarciab authored Jun 11, 2024
1 parent c1ce22d commit a79f7c9
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,42 @@ There are a few packages that are installed by default (e.g., pandas, pyreadstat

If you need specific versions, you need to email CBS a environment.yml file with your requirements. This repository has a standard environment.yml with most of the tools researchers use. Before sending it, open "environment.yml" and change the number (0000 in the example) for your project number.

You can also create your own environment file locally, where 0000 is your project number:
```sh
conda create -n 0000 -c conda-forge python=3
conda activate 0000
conda install jupyter notebook scikit-learn pandas matplotlib seaborn jupyterlab notebook plotly IPython pyreadstat openpyxl dask vaex modin polars pyarrow numpy scipy statsmodels pymc3 eli5 SHAP LIME networkx igraph tensorflow keras pytorch pytorch_geometric
conda env export --from-history > ~/environment.yml
```

If you require specific versions, you can check `conda env export` and add the versions to the `environment.yml` file.
To create the YML file, you need to create your own environment outside the RA environment, in Python on Windows, using Mambaforge installed in C:\mambaforge. Follow the steps below to generate a text file and send it to us via email as a reply. With the text file, we can make the environment available for you within RA.


On your own Windows system in Python, create a new environment named after the project code and activate it. As an example, we use project code 0000.

a. `conda create –n 0000`

b. `conda activate 0000`

Install pip.
`conda install pip`

Then, install the required packages with pip.
`pip install package_name`

Export the environment with pip.
`pip freeze > C:\temp\environment0000.txt`
Check that the file does not contain references to local paths (file://).
If it does, use the following command:
pip list --format=freeze > C:\temp\environment0000.txt

Test the environment by removing and recreating it.
`rd /q /s <path to python>\envs\0000`
`conda create –n 0000`
`conda activate 0000`
`conda install pip`
`pip install –r C:\temp\environment0000.txt`
Test the Python environment.

Send the environment text file to us via email.



Note! If you want to use Jupyter Notebook or Spyder, you need to install them in the environment as well.

Once CBS has installed it, you may see a new icon with the right version of Python. If this is not the case, you need to activate the Python environment manually. You can open a `Python Prompt`, and run the following code, where 0000 is your project number:

```sh
conda activate 0000.
Expand Down

0 comments on commit a79f7c9

Please sign in to comment.