intel / intel-extension-for-pytorch

A Python package for extending the official PyTorch that can easily obtain performance on Intel platform
Apache License 2.0
1.55k stars 236 forks source link

import error: no module named 'intel_extension_for_pytorch' #194

Closed changwangss closed 2 years ago

changwangss commented 2 years ago

hi I install ipex from release/1.10 branch. I import package according the examples but I still occur the error 'no module named intel_extension_for_pytorch'. the pip list show the ipex package named 'intel-extension-for-pytorch'. but the examples show we need import 'intel_extension_for_pytorch' . if I import 'intel-extension-for-pytorch', it will raise 'invalid syntax'.

env: python 3.8 ipex release/1.10 branch

(ipex-1p10-py38) [changwa1@mlt-skx088 ptq]$ pip list|grep torch
intel-extension-for-pytorch 1.10.0+cpu
torch                       1.10.0
torchvision                 0.11.1
(ipex-1p10-py38) [changwa1@mlt-skx088 ptq]$ python
Python 3.8.12 (default, Oct 12 2021, 13:49:34)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import intel_extension_for_pytorch as ipex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'intel_extension_for_pytorch'
EikanWang commented 2 years ago

image Could you check the package name in your local environment? My local env path like "~/miniconda3/envs/stock-pyt/lib/python3.8/site-packages/"

EikanWang commented 2 years ago

@changwangss , may i know if you still encounter this issue? I wonder if you could clean your local environment and reinstall ipex 1.10 from source again.

changwangss commented 2 years ago

thank you very much. I reinstall and success. I think reason maybe --recursive failed or not clean before setup. this issue can be closed.