问题
I am creating a virtual environment testenv
to run some python project. This is my environment.yml
file:
name: testenv
channels:
- !!python/unicode
'defaults'
dependencies:
- python=3.5
- pip==9.0.1
- numpy==1.12.0
- jupyter==1.0
- matplotlib==2.0.0
- scikit-learn==0.18.1
- scipy==0.19.0
- pandas==0.19.2
- pip:
- tensorflow==1.1.0
- keras==2.0.4
- plotly==2.7.0
I want to add pygame
to this environenment. However, if I add pygame==1.9.4
to dependencies
or pip
, then the creation of a virtual environment fails:
conda env create
Therefore I should source activate testenv
and then install pygame
manually, but it's not very convenient.
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
pip install pygame
Has anybody tried installing pygame
in the automated way in the virtual environment?
回答1:
To create environment:
conda env create -f environment.yml
To generate your yml:
conda env export > environment.yml
More informations in the documentation
来源:https://stackoverflow.com/questions/52059053/how-to-install-pygame-automatically-when-virtual-environment-is-created