Fastai v1 install issues thread

I don’t have it running yet, I don’t know why I find to get it working so hard.

So here’s the exact steps I took :

  • create new conda env with python 3.6
  • installed fastai and pytorch usingconda install -c pytorch -c fastai fastai
  • uninstalled fastai with conda uninstall fastai (also checked there’s no pip installation)
  • Ran the following commands

git clone https://github.com/fastai/fastai
cd fastai
tools/run-after-git-clone
pip install -e .[dev]

But then importing fastai doesn’t work in the notebooks :ImportError: No module named 'fastai'

I really don’t see what I could be doing wrong, I followed the simplest doc I could find to the letter.

Please tell me if I should be posting this elsewhere.

@PierreO, I moved your post to this thread where it belongs.

First, I updated the instructions https://github.com/fastai/fastai/blob/master/README.md#developer-install - so it’s just the code you quoted, w/o needing to install/uninstall anything.

Second, you probably don’t have your conda env activated when you start jupyter so it’s looking for fastai in the system-wide python.

You can check with: https://docs.fast.ai/troubleshoot.html#support

python -c 'import fastai; fastai.show_install(1)'
2 Likes

All right it’s working thank you very much !

1 Like

Glad to hear it’s working.

And for the future, when you ask a question and then sort it out, please add details of what you did differently from your original post to make it work, so that others with the same issue will know how to resolve it too reading your resolution. Thank you.

1 Like

Note that:

python -c 'import fastai; fastai.show_install(1)'

has changed to:

python -m fastai.utils.show_install

2 posts were merged into an existing topic: Developer chat

@stas, I had a similar issue.

  1. Created an environment
  2. Ran conda install -c pytorch -c fastai fastai. At this point my jupyter notebook would fail when running from fastai import * and from fastai import vision.
  3. I then ran conda install nb_conda_kernels (as per this solution: https://stackoverflow.com/questions/39604271/conda-environments-not-showing-up-in-jupyter-notebook) and it worked perfectly.

I am using:

  • Python 3.6.7 :: Anaconda custom (64-bit)
  • OS: OSX 10.13.6

OK, I did a bit of digging.

  1. Can you confirm by repeating this in a newly created env, where you install nb_conda instead of nb_conda_kernels? I ask that because the latter is a dependency for the former. And the SO thread you linked to suggests that people needed the former too.

  2. It looks like nb_conda is a dependency of anaconda - Since you didn’t show how you created the environment - am I correct to assume that you’re either running a minimal conda environment or miniconda, i.e. you don’t have anaconda installed?

    Though this is how I have my setup done (no anaconda installed) and I don’t have nb_conda installed, and it has no problems you describe (though I’m on linux).

So, once you confirm that (1) works, I will add nb_conda to the fastai deps.

Thank you.

I tried to install fastai again in a new EC2 Instance. But I got an error when I install torchvision-nightly using “conda install -c fastai torchvision-nightly”. The error is:

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • torchvision-nightly

Current channels:

To search for alternate channels that may provide the conda package you’re
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Any idea?

The installation instructions have changed, please see: https://github.com/fastai/fastai/blob/master/README.md#installation

1 Like

I used

conda install -c pytorch -c fastai fastai

and it worked like a charm.

It would be nice if the installation description at AnacondaCloud would also be updated:
https://anaconda.org/fastai/fastai

I am trying to execute the code but getting following error when i try to execute
from fastai.vision import *
ModuleNotFoundError: No module named ‘fastai.vision’

But,
from fastai import * - this works smoothly

I am not sure, is this the correct thread to ask this issue

It’s not possible at the moment. Anaconda.org thinks it’s the right command, and won’t let the maintainer to edit it to set it right. I have the same problem with other modules that require custom -c channel.

I filed a bug report with anaconda.org, but based on my previous experience with doing that, it may take months for anybody to respond there, and then usually a clueless support person will have no idea what to do with it and would say, I will pass the request on, thank you. :frowning:

This is the right place, @niki196 . But, please, see: https://docs.fast.ai/support.html#reporting-installation-issues

Most likely you installed fastai into one location, but running your notebook from another. But I have no way of telling what you have been doing to give you a helpful answer.

Thanks @stas… you are absolutely correct :slight_smile:

1 Like

I’m having issues installing as well. Hoping to get some help as well @stas .

Problem:

  • No module named ‘fastai.vision’
  • CUDA no longer detected. Worked fine in my FastAI .7 installation

Steps I’ve tried:

  1. Works:
    import torchvision
    from fastai.text import *

  2. import sys
    print(sys.path)
    [’’, ‘/home/ray/anaconda3/envs/fastai/lib/python36.zip’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6/lib-dynload’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/defusedxml-0.5.0-py3.6.egg’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/torchvision-0.2.0-py3.6.egg’, ‘/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/IPython/extensions’, ‘/home/ray/.ipython’]

  3. Steps documented in https://docs.fast.ai/support.html#reporting-installation-issues . This is the output

(fastai) ray@rayml:~$ python -c ‘import fastai.utils.collect_env; fastai.utils.collect_env.show_install(1)’

=== Software === 
python version : 3.6.8
fastai version : 1.0.34
torch version  : 1.0.0
nvidia driver  : 396.44
torch cuda ver 
torch cuda is  : **Not available** 

=== Hardware === 
nvidia gpus    : 1
Have 1 GPU(s), but torch can't use them (check nvidia driver) 

=== Environment === 
platform       : Linux-4.4.0-21-generic-x86_64-with-debian-stretch-sid
distro         : #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016
conda env      : fastai
python         : /home/ray/anaconda3/envs/fastai/bin/python
sys.path       : 
/home/ray/anaconda3/envs/fastai/lib/python36.zip
/home/ray/anaconda3/envs/fastai/lib/python3.6
/home/ray/anaconda3/envs/fastai/lib/python3.6/lib-dynload
/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages
/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/defusedxml-0.5.0-py3.6.egg
/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/torchvision-0.2.0-py3.6.egg
/home/ray/anaconda3/envs/fastai/lib/python3.6/site-packages/IPython/extensions

Tue Jan  8 23:02:32 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.44                 Driver Version: 396.44                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   46C    P5    21W / 151W |      0MiB /  8117MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Please make sure to include opening/closing ``` when you paste into forums/github to make the reports appear formatted as code sections.

Optional package(s) to enhance the diagnostics can be installed with:
pip install distro
Once installed, re-run this utility to get the additional information

Does the error come in the notebook cell, or the console, @Raymond-Wu ? did you make sure you activated your conda env before starting jupyter?

Run the same show_install code from the notebook cell, so you will know for sure.

Besides, you’re using an old version of fastai, which tells me you probably have some kind of environment issues. i.e. if you have just installed fastai, it would have been version 1.0.39.

If everything else fails, create a new env, activate it, install fastai in there and check whether it works.

Here’s a notebook output @stas . I am using my fastai environment in both the terminal as well as the notebook.

Odd regarding the Fastai version. I just updated it right before I posted. This is the latest version I’m getting from conda install

Try to install the specific (latest as of this comment) version:

conda install -c fastai fastai==1.0.39

If it doesn’t install that means you have a conflict of dependencies, create a fresh env and install there
https://docs.fast.ai/troubleshoot.html#cant-install-the-latest-fastai-conda-package

Tried creating a brand new environment as well and installing there. This was the error that popped up in my old fastai environment as well as the new fastaiv1test environment