Pycharm set up

Hi,

I am trying to set up pycharm for part 2. I opened the root directory of the git as the root directory for the project in pycharm, however, a lot of imports in the code do not work yet. For example, I opened the ./fastai/conv_learner.py I see the from .core import * is gray and in the code, nn which I think is from pytorch is not resolved. Anyone has already set it up could share the tips? Thank you!

Hi, did you installed all requirements using
pip install -r requirements.txt
on project root directory?

Also have you set the interpreter for the project to the fastai conda env (in settings)?

1 Like

We don’t recommend doing that - we recommend using the conda approach taught in the course. (For those who prefer or require pip, that’s fine, but it’s best not to recommend it to other students since they’ve likely used conda, and running that pip command could cause problems with their environment).

2 Likes

I have run the notebook from the first lesson without any problem, also have set the interpreter to the virtual env

Ok, I solved this problem, for what it is worth, the issue was with the python interpreter, the correct one should be …/anaconda/envs/fastai/bin/python, the default one points to the fastai virtual env inside the project directory, which is not correct.

1 Like