Fastai v1 install issues thread

(Stas Bekman) #248

Thanks for the extra suggestions, @brismith.

My instructions already included:

conda install -y conda

unlike pip install -U with conda you don’t need to tell it to update, its normal install always updates if there is an update.

and his notebook shows the correct environment (right upper corner), just waiting to see the paths.

and we recently included nb_conda in conda deps, as some people had issued w/o this package.


Here are the responses I got:

P.S. This was still using the Python [conda env:fastai-please-work]

(Stas Bekman) #250

Very odd. Perhaps your conda setup is screwed up? I mean not the environment, but the whole thing? Perhaps trying to install conda from scratch?

Can you load other packages from the notebook? Print their sys.modules[‘package_name_here’] and see that the path matches the real thing?

(Peter Veber) #251

Hi Stas,

Sorry for super beginner question. But how to create new environment for fastai v1? If I understand this correctly it is command like this: conda env create -f environment.yml

Is there somewhere environment.yml for fastai v1?
Because for environment.yml what I found is comment:
# use/edit this file only for working with fastai-0.7.x version

BTW my environment is build on Ubuntu 18.04

Thanks a lot

(Brian Smith) #252

conda create -n fastai python=3.7
conda activate fastai
conda install pytorch torchvision -c pytorch
conda install -c fastai fastai

The last two steps should install all you need in the fastai env. The remove an env you don’t need:
conda env remove -n fastai
To list all envs
conda env list

(Brian Smith) #253

Could something bad or out of date get pulled in from cache - rather than re-loading? I agree that a fresh start sounds good. I haven’t seen a conda list output, but the earlier torchvision error looks like it is stuck on fastai 1.0.34,

(Stas Bekman) #254

But 1.0.34 is just 1 month old, so even with this outdated version, all those modules are the same. The stuckness is a different symptom (conflict with dependencies from other packages), but it should still load.

I reviewed your previous posts, @Raymond-Wu, and now I see that here it did actually do the right thing - it was able to start loading fastai.text, but it was loading it from courses/dl2/fastai symlink which points to the fastai-0.7 source. I think this is the problem. You are trying to run the course-v2 files which require fastai 0.7 with fastai v1.

If you’re trying however to run fastai-0.7 because you want to run course v2 files, then of course we can’t solve it, since we are solving the wrong problem. In this case this discussion should be done over at Fastai v0.7 install issues thread and you will be not installing fastai-v1 in that case, but fastai-v0, follow the instructions in that thread instead.


I actually tried loading thing from terminal and activating the environment. It just doesn’t seem to work from Jupyter?

Edit: Just saw stas’ new message. How do I point the symlink to a new folder?

(Stas Bekman) #256

How do I point the symlink to a new folder?

Please reread what I wrote, you’re mixing things up. You don’t need to change any symlinks.

Which course are you trying to follow?


!!! Stas thank you for being so patient with me. I reread your message and now got everything to work! I owe you a coffee or something. Thanks for unblocking me!

(Stas Bekman) #258

Yay, glad to hear we sorted this puzzle out. And I learned to ask a simple question of the output of pwd :wink:

(Peter Veber) #259

Hi guys,

Can you please tell me what I’m doing wrong?

I have fresh installation of Ubuntu 18.04. and I want install latest fastai. So currently v 1.0.39

Here are my steps:
Download latest conda. Currently
Open terminal
command: $ bash (installed successfully with no errors)
command: $ sudo apt install nvidia-390 (installed successfully with no errors)

Reboot system!

Open terminal again and run this commands:
$ conda create -n fastai python=3.7 (created with no errors)
$ conda activate fastai
$ conda install pytorch torchvision -c pytorch (installed successfully with no errors)
$ conda install -c fastai fastai (version 1.0.39 is installed successfully with no errors)

Reboot system!

Terminal again and:
$ conda activate fastai
$ jupyter notebook

This automatically open new browser window with jupyter notebook and until now everything looks correct.

But when I try ran:
from fastai import *
from import *
from import *
import torch

I have this error:
ModuleNotFoundError: No module named ‘’

So it is looks like I’m runnig v0.7 or something.

Any idea what I’m doing wrong and how can I fix it?

I already tried few other similar way how to install latest fastai including pip but I have still same result

ModuleNotFoundError: No module named ‘’

Thanks a lot for your help.

(Stas Bekman) #260

Ha, read the very last posts above yours. My guess is that you’re having the same issue. Luckily we have just resolved it.

Do not go under /courses (fastai 0.7 notebooks) when you load the notebook, go under examples/ instead

/courses/dl1 and course/dl2 symlink to old/fastai, so everything gets messed up. Stay out of /courses and it should all work.

And no, you don’t need to reboot your computer when you install python modules.

(Peter Veber) #261

Thanks Stas,

You are right. I’m running my notebook from /courses/dl1 so your solution should help.

Thanks a lot for super quick response.

Have a great day

(Bobak Farzin) #262

In a PR request, I pulled the latest developer version of fastai the following commands in a clean environment. I then had two problems which I think I solved, but want to post here so others know what to do if they see this.

$conda create --name fai_v1_dev python=3.7
$conda activate fai_v1_dev
$pip install -e ".[dev]"

I do have some pip versions and some base conda versions of the a subset of libraries installed.

When I do this install, I get: Numpy version problem

First, I cannot run the demo tabular.ipynb without throwing an error about
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

The resolution is to:

  • Rollback the version of Bottleneck with:
    pip install Bottleneck==1.2.0


  • Upgrade numpy to pre-release version:
    pip install numpy==1.16.0rc1

Both resovle my issue and allow me to compile the tabular.ipynb notebook with no errors.

Show install information:

=== Software === 
python        : 3.7.1
fastai        : 1.0.40.dev0
fastprogress  : 0.1.18
torch         : 1.0.0
nvidia driver : 396.51
torch cuda    : 9.0.176 / is available
torch cudnn   : 7401 / is enabled

=== Hardware === 
nvidia gpus   : 2
torch devices : 2
  - gpu0      : 12194MB | TITAN Xp
  - gpu1      : 12196MB | TITAN Xp

=== Environment === 
platform      : Linux-4.15.0-32-generic-x86_64-with-debian-stretch-sid
distro        : Ubuntu 16.04 Xenial Xerus
conda env     : fai_v1_dev
python        : /home/farzin/anaconda3/envs/fai_v1_dev/bin/python
sys.path      : 

Fri Jan 11 14:32:56 2019    
| NVIDIA-SMI 396.51                 Driver Version: 396.51                    |
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  TITAN Xp            Off  | 00000000:03:00.0 Off |                  N/A |
| 30%   47C    P8    21W / 250W |     12MiB / 12194MiB |      0%      Default |
|   1  TITAN Xp            Off  | 00000000:04:00.0  On |                  N/A |
| 23%   36C    P8    17W / 250W |    979MiB / 12196MiB |      3%      Default |
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|    1      1433      G   /usr/lib/xorg/Xorg                           661MiB |
|    1      2423      G   compiz                                       302MiB |
|    1     22300      G   /usr/lib/firefox/firefox                       3MiB |

Developer chat
(Stas Bekman) #263

I was able to reproduce this problem following your instructions. Mine was installed via conda and had no such problems.

So as you identified pip installs incompatible versions of some of the numpy functionality and bottleneck, conda’s versions of these packages don’t have that problem. The problem happens during pandas’ import.

There is a third workaround:

pip install git+

I filed a bug report:

It looks like a new long overdue release is being tested:, so perhaps let’s wait a little bit and perhaps it’ll get resolved automatically with the new release.

If, however, it gets delayed and/or new numpy is still not released, we will pin pip to bottleneck=1.2.0 for the next fastai release.

As you can see from the bug report, I managed to reduce the problem to:

python -c "import pandas"
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

(Devon Kaberna) #264

Hi everyone,

Forgive the noob question here, but I am purposely working under 1.0.36.post1. I am using bash-git-prompt. When I am in the fastai folder, I am able to confirm I am using version 1.0.36.post1. When create a new folder for Kaggle competitions within the fastai folder, and then cd into the Kaggle folder, I check the version and now see that I am using 1.0.40.

All of this is done within a virtual environment. Any ideas on how I can make sure I am still under 1.0.36.post1? Apologies if I am supposed to be asking this question under a different thread than this one.

Developer chat
(Stas Bekman) #265

You probably have fastai installed in two places (and perhaps you have a symlink that gets the wrong version).

See this

and certainly follow the instructions here:

Use locate fastai/ if you’re on unix to find all the instances and then you will see if you have it installed twice. You probably have some symlinks pointing to a second install or something similar. Can’t tell without a proper report.

p.s. if you’re working with the git checkout, there was originally also a git cross-over in the 1.0.36 branch (with master HEAD) that has been fixed since then, so if you’re using the 1.0.36 branch, you need to update it.

(Stas Bekman) split this topic #266

A post was merged into an existing topic: Misc issues

(Stas Bekman) pinned #267