Skip to content

apex ImportError on Google Colab #585

@mhiro216

Description

@mhiro216

I try to install apex for pytorch on Google Colab.

I followed the install directions as follows, and the install seem to succeed.

!git clone https://github.com/NVIDIA/apex; cd apex; pip3 install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" . --user

apex seem to be installed at:

!cd '/root/.local/lib/python3.6/site-packages'; ls
...
amp_C.cpython-36m-x86_64-linux-gnu.so
 apex
 apex-0.1-py3.6.egg-info
 apex_C.cpython-36m-x86_64-linux-gnu.so
'~-ex'
'~-ex-0.1-py3.6.egg-info'
 fused_layer_norm_cuda.cpython-36m-x86_64-linux-gnu.so
'~pex'
'~pex-0.1.dist-info'
'~pex-0.1-py3.6.egg-info'
 syncbn.cpython-36m-x86_64-linux-gnu.so

but when I check sys.modules['apex'], this shows just namespace, not like other modules:

sys.modules['apex']
...
<module 'apex' (namespace)>

other modules show like this:

sys.modules['pandas']
...
<module 'pandas' from '/usr/local/lib/python3.6/dist-packages/pandas/__init__.py'>

sys.path shows paths as follows:

sys.path
...
['/usr/lib/python36.zip',
 '/root/.ipython',
 '/root/.local/lib/python3.6/site-packages/',
 '/env/python',
 '/usr/lib/python3.6/lib-dynload',
 '/usr/local/lib/python3.6/dist-packages',
 '/usr/local/lib/python3.6/dist-packages/gitdb/ext/smmap',
 '/content/gdrive/My Drive/Colab Notebooks/kaggle-severstal-master/',
 '/usr/lib/python3.6',
 '/usr/lib/python3/dist-packages',
 '/usr/local/lib/python3.6/dist-packages/git/ext/gitdb',
 '/usr/local/lib/python3.6/dist-packages/IPython/extensions']

Could someone help me out to set the right position to read apex?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions