Fastai v1 install issues thread

About Windows I think the best option will arrive when Microsoft will enable GPU access on WSL 2 or future release.
https://devblogs.microsoft.com/commandline/wsl-2-post-build-faq/
Its in the pipeline, will wait and see, Windows it’s still my primary OS till I will be able to switch.

1 Like

Interesting. Though they may mean something more like the GPU support HyperV currently has without PCIe passthrough which presents a virtualised GPU driver and does not support CUDA. Otherwise I think you’d need either specific driver support from nVidia or PCIe passthrough (and the various compatibility issues there). I don’t think even linux virtualisation does CUDA without PCIe passthrough (or it’s through the specifically designed multi-tenant professional cards).
Maybe though, would be nice.

I am unable to start my Salamander.ai server. I get the message ‘We tried starting your server but failed because: “no available servers”’.

1 Like

Hi,

I’m trying to submit a job to Google Cloud Platform (see AI Platform and Packaging) for a fastai project. It terminates on the installation with error:

ERROR: Package ‘trainer’ requires a different Python: 2.7.9 not in ‘>=3.7’

I know fastai requires python 3, but I can’t seem to get python 3 from the setup.py:

from setuptools import find_packages
from setuptools import setup

REQUIRED_PACKAGES = [‘torch>=1.3.0’, ‘fastai>=1.0.59’]

setup(
name=‘trainer’,
python_requires=’>=3.7’,
version=‘1.0’,
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=True,
description=‘My training application package.’
)

Thanks

On macos Catalina with fastai==1.0.60 I get the following error:
ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'

I suppose this is related to the latest version of pillow not having PILLOW_VERSION anymore.

Workaround with:

pip uninstall pillow
pip install 'pillow>=6.0.0,<7.0.0'

Related code:

1 Like

having problems to install fastai on my shiny Raspberry Pi 4 with 4GB, Raspbian Buster OS

I have spent 2 days on getting things e.g. PyTorch, imgaug etc. running on my Pi and finally I made my way to touch Fast.Ai, but sadly, it failed at installing fast.ai.

I followed this post to install Fast.Ai on Pi

After installed all dependencies successfully, I started installing fastai:

sudo pip3 install fastai --upgrade > /dev/null

here is the error:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-i0byv1vc/spacy/

Please help, I think this is the last barrier to get Fast.Ai on my Pi~!

Thanks

I don’t know for Google - but I had a similar problem using basic Azure WebApp and needed to add a runtime.txt at the root - that just contain ‘python-3.6’ In that case the options were limited to 2.7, 3.4, 3.5 and 3.6 from memory. Maybe Google has a similar file that tells it which environment it needs?
(Only just noticed this thread is quite old - hope you found your answer by now)

Has anyone manage to install fastai on Clear Linux?

Doing a pip install fastai results in the following:

$ pip install fastai
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: fastai in /home/ubu/.local/lib/python3.8/site-packages (1.0.60)
Requirement already satisfied: pandas in /usr/lib/python3.8/site-packages (from fastai) (1.0.0)
Requirement already satisfied: Pillow in /usr/lib/python3.8/site-packages (from fastai) (6.2.2)
Requirement already satisfied: pyyaml in /usr/lib/python3.8/site-packages (from fastai) (5.3)
Collecting torchvision
  Downloading torchvision-0.5.0-cp38-cp38-manylinux1_x86_64.whl (4.0 MB)
     |████████████████████████████████| 4.0 MB 3.6 MB/s 
Requirement already satisfied: torch>=1.0.0 in /usr/lib/python3.8/site-packages (from fastai) (1.3.0a0)
Requirement already satisfied: requests in /usr/lib/python3.8/site-packages (from fastai) (2.22.0)
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.8.2-py3-none-any.whl (106 kB)
     |████████████████████████████████| 106 kB 9.2 MB/s 
Requirement already satisfied: scipy in /usr/lib/python3.8/site-packages (from fastai) (1.4.1)
Collecting numexpr
  Using cached numexpr-2.7.1-cp38-cp38-manylinux1_x86_64.whl (164 kB)
Requirement already satisfied: matplotlib in /usr/lib/python3.8/site-packages (from fastai) (3.0.2)
Collecting spacy>=2.0.18
  Using cached spacy-2.2.3-cp38-cp38-manylinux1_x86_64.whl (10.3 MB)
Collecting fastprogress>=0.2.1
  Using cached fastprogress-0.2.2-py3-none-any.whl (12 kB)
Collecting nvidia-ml-py3
  Using cached nvidia-ml-py3-7.352.0.tar.gz (19 kB)
Requirement already satisfied: packaging in /usr/lib/python3.8/site-packages (from fastai) (20.1)
Requirement already satisfied: numpy>=1.15 in /usr/lib/python3.8/site-packages (from fastai) (1.18.1)
Collecting bottleneck
  Using cached Bottleneck-1.3.1.tar.gz (88 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-3lea3q_k/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'numpy==1.13.3; python_version=='"'"'2.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'2.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.5'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"''
       cwd: None
  Complete output (591 lines):
  Ignoring numpy: markers 'python_version == "2.7" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.5" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "2.7" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.5" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.7" and platform_system == "AIX"' don't match your environment
  Collecting setuptools
    Using cached setuptools-45.1.0-py3-none-any.whl (583 kB)
  Collecting wheel
    Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
  Collecting numpy==1.14.5
    Using cached numpy-1.14.5.zip (4.9 MB)
  Building wheels for collected packages: numpy
    Building wheel for numpy (setup.py): started
    Building wheel for numpy (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ikrpmj8t/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ikrpmj8t/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-dia71_4m
         cwd: /tmp/pip-install-ikrpmj8t/numpy/
    Complete output (262 lines):
    Running from numpy source directory.
    /tmp/pip-install-ikrpmj8t/numpy/numpy/distutils/misc_util.py:464: SyntaxWarning: "is" with a literal. Did you mean "=="?
      return is_string(s) and ('*' in s or '?' is s)
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

I tried using anaconda and it seemed to work like a charm. I used python 3.6 though, because PyTorch seems to like it better. It also does say that you have already installed it

Requirement already satisfied: fastai in /home/ubu/.local/lib/python3.8/site-packages (1.0.60)

I would just try python 3.6 instead of 3.8 and maybe use conda

I had the same issue on a fresh install on Win10, and solved the issue with the same approach.

ImportError: cannot import name ‘Optional’

How to replicate
Tried installing FastAI on windows PC using following commands
1)first created conda using following command
conda create -n fastai_v1 python=3.6
2)conda activate fastai_v1
3)(fastai_v1) C:>conda install -c pytorch pytorch-cpu torchvision
Install succesful
4)(fastai_v1) C:>conda install -c fastai fastai
Succesful
5) tried importing fastai and error occurred

Error
##################
(fastai_v1) C:>python
Python 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 15:18:16) [MSC v.1916 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

from fastai.vision import *
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\fastai\vision_init_.py”, line 3, in
from .learner import *
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\fastai\vision\learner.py”, line 6, in
from . import models
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\fastai\vision\models_init_.py”, line 2, in
from torchvision.models import ResNet,resnet18,resnet34,resnet50,resnet101,resnet152
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\torchvision_init_.py”, line 3, in
from torchvision import models
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\torchvision\models_init_.py”, line 5, in
from .inception import *
File “C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages\torchvision\models\inception.py”, line 8, in
from torch.jit.annotations import Optional
ImportError: cannot import name ‘Optional’
####################

Output from (fastai_v1) C:>python -m fastai.utils.show_install

=== Software ===
python       : 3.6.10
fastai       : 1.0.60
fastprogress : 0.2.2
torch        : 1.1.0
torch cuda   : None / is **Not available**

=== Hardware ===
No GPUs available

=== Environment ===
platform     : Windows-10-10.0.18362-SP0
conda env    : fastai_v1
python       : C:\Users\JOHNY\Anaconda3\envs\fastai_v1\python.exe
sys.path     :
C:\Users\JOHNY\Anaconda3\envs\fastai_v1\python36.zip
C:\Users\JOHNY\Anaconda3\envs\fastai_v1\DLLs
C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib
C:\Users\JOHNY\Anaconda3\envs\fastai_v1
C:\Users\JOHNY\Anaconda3\envs\fastai_v1\lib\site-packages
no supported gpus found on this system

Solved this by upgrading pytorch.
Then another error occurred
Preformatted textfrom PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION ImportError: cannot import name 'PILLOW_VERSIONPreformatted text
This was solved up upgrading pytorch to nightly version

This is a brilliant idea. Thanks for this I am looking for this on our project at data science company

Hi All,

I am trying to install fastai v1 on my laptop which has no GPU. So, I first installed pytorch using: conda install pytorch torchvision cpuonly -c pytorch. Then, I installed fastai using pip install fastai.

While running the first notebook in the dl1 course, I got the following error while trying to:
from fastai.vision import *
from fastai.metrics import error_rate

ImportError: libcudart.so.10.0: cannot open shared object file: No such file or directory

Can someone please explain what I have missed?

Do I need to install Nvidia drivers as this page says (https://github.com/fastai/fastai/blob/master/README.md#installation-issues)?. Please note that my machine has no GPU.

The following works:
import torch
x = torch.rand(5, 3)
print(x)

But
import torchvision

fails with the error ImportError: libcudart.so.10.0: cannot open shared object file: No such file or directory

I have built and used Singularity containers with fastai. Actually works quite well in a multi-user HPC cluster environment with shared network drives and a common DL data store, as the Singularity container tech automatically inherits and preserves the user’s permissions, avoiding the risk of accidentally breaking/messing up the things/files of other users/groups, while easily allowing access to a common data store without having to worry too much about “mounting” volumes with the right permissions/groups etc.

Let me know what trouble/problem you have, and we can try and figure something out together?

(Apologies for the super-delayed reply here – in recent months I have not had time to follow fastai and the forums as much as I wanted to.)

Regards,
Yijin

If your machine has no GPU, you don’t have to install NVIDIA drivers (since there is no NVIDIA GPU to ‘drive’!)

Though note that your DL work will also be quite (very!) slow on CPU…

Regards,
Yijin

@paulmp, in case you are still using Singularity+fastai, I have now written a blog post about my use of fastai2 in Singularity. Please see my forum post here, and the link to the blog post here. Thanks.

Yijin

I was following the fastai install instructions at https://github.com/fastai/fastai/blob/master/README.md#installation and successfully installed fastai. from fastai import * works but from fastai.vision import * fails with

ImportError: cannot import name ‘ResNet’ from ‘torchvision.models’ (unknown location)

I am working on a IBM Power (ppc64le) system

(fastai-new) [cecuser@p605-kvm1 ~]$ uname -a
Linux p605-kvm1 4.14.0-115.8.1.el7a.ppc64le #1 SMP Thu May 9 14:45:13 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux

Here is the conda info if that helps …

     active environment : fastai-new
    active env location : /home/cecuser/anaconda3/envs/fastai-new
            shell level : 3
       user config file : /home/cecuser/.condarc
 populated config files : /home/cecuser/anaconda3/.condarc
                          /home/cecuser/.condarc
          conda version : 4.7.10
    conda-build version : 3.18.8
         python version : 3.7.3.final.0
       virtual packages : __cuda=10.1
       base environment : /home/cecuser/anaconda3  (writable)
           channel URLs : http://129.40.242.3/repos/powerai/1.6.2/ibm-ai/conda/linux-ppc64le
                          http://129.40.242.3/repos/powerai/1.6.2/ibm-ai/conda/noarch
                          http://129.40.242.3/repos/powerai/1.6.2/conda/pkgs/r/linux-ppc64le
                          http://129.40.242.3/repos/powerai/1.6.2/conda/pkgs/r/noarch
                          http://129.40.242.3/repos/powerai/1.6.2/conda/pkgs/main/linux-ppc64le
                          http://129.40.242.3/repos/powerai/1.6.2/conda/pkgs/main/noarch
          package cache : /home/cecuser/anaconda3/pkgs
                          /home/cecuser/.conda/pkgs
       envs directories : /home/cecuser/anaconda3/envs
                          /home/cecuser/.conda/envs
               platform : linux-ppc64le
             user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Linux/4.14.0-115.8.1.el7a.ppc64le rhel/7.6 glibc/2.17
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Hi all,

Not sure how active this is but I’m trying to install on windows to use a GAN.
When I get to “conda install -c pytorch -c fastai fastai” - I get a couple fails, then it finds conflicts and finally fails saying the following:

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your CUDA driver:

  • feature:/win-64::__cuda==10.2=0
  • feature:|@/win-64::__cuda==10.2=0

Even on pip install I had a problem saying it “Failed to build bottleneck
ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly”.

ANY HELP PLEASE? Young person with no experience coding except a bit in Houdini FX.