Pip Virtualenv Conda or Docker for beginner

Installed since a few days my first Linux PC ever, approaching the stage want to configure the environment for testing and learning with fastai and other frameworks.

Confused what’s the more beginner (with just basic Python experience) friendly way to install and use fastai and the cuda acceleration.

When I was on Windows I tried Docker as the most safe solution, one image with all. On Linux I think pip, virtualenv, conda (but also pipenv or others) are also suitable but can’t understand how to proceed nor want to start messing with my new system.

Also my idea was using some IDE such as Kdevelop (installed Kubuntu) to ease my Python usage, so my concern is how complex is working with various setups and an IDE (i. E. Just discovered it’s not straightforward to make docker container read the external host file system).

Would IPython Notebook do it for you, too (instead of an IDE)? If you do it in a virtualenv, it shouldn’t mess up anything. Just a few commands (but quite some megabytes) and you’re in your notebook. (Worked for me in Ubuntu and Lubuntu).

conda create -n myenv
source activate myenv
conda install jupyter
conda install -c pytorch -c fastai fastai

You can still install a proper editor (Visual Studio Code or Sublime Text) just normally with apt-get or GUI tools, to be able to navigate in fastai or pytorch code.


Thanks @Max1 for answering!
Jupiter will enable cuda acceleration?
Also testing a bit virtualenv I find it not persistent, so I’ll loose everything I have installed inside the virtualenv. It’s something just need to be configured?

Jupyter is just your GUI for entering python commands. As far as I know pytorch brings its own cuda inside. If worried about corrupting an env, you might want to clone it first and try things inside that clone.

1 Like

Thanks @Max1 I’ll try it

Just to let know I finally settled on conda.
Docker will be sure good for production when you need to deploy or redeploy different applications, but for a beginner add an unnecessary layer of complexity (i.e. Local drive file access for me was a stop gate).
Pip can in fact be used inside conda, and conda does have the more general purpose package and dependencies management (not limited to python) a perfectly working virtual environment, and trough Anaconda Navigator also a UI that ease the life for a beginner I. E. with ready to use Jupiter Notebook and visual env management.

Glad to hear that you’re done with the setup and can move on to the DL itself.
I’m currently using miniconda instead of anaconda - I didn’t want extra packages. Commands are the same.

1 Like