ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

import error

Open jsjs0827 opened this issue 3 years ago • 9 comments

In Ubuntu 16.04 LTS,cmake,make and setup are all done. python import ncnn ModuleNotFoundError: No module named 'ncnn.ncnn'. What should I do?

jsjs0827 avatar Mar 16 '21 11:03 jsjs0827

pip show ncnn ?

ncnnnnn avatar Mar 19 '21 01:03 ncnnnnn

i meet same error

Linaom1214 avatar Mar 28 '21 09:03 Linaom1214

this comes from the file "init.py"; in line 15 ------> [ from .ncnn import *], but no solution was found.

lz-tc avatar Apr 08 '21 13:04 lz-tc

first install pybind11 second cd ncnn/python ' python setep.py install ' i successed in ubuntu 20.04

Linaom1214 avatar Apr 10 '21 11:04 Linaom1214

first install pybind11

second cd ncnn/python ' python setep.py install '

i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

lz-tc avatar Apr 10 '21 15:04 lz-tc

first install pybind11 second cd ncnn/python ' python setep.py install ' i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

I guess you forget make the NCNN , you should first make NCNN in the markdown file in NCNN/python you can see more

Linaom1214 avatar Apr 14 '21 02:04 Linaom1214

first install pybind11 second cd ncnn/python ' python setep.py install ' i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

Try to build ncnn with gcc-7. The detailed steps are:

export CC=<path/of/gcc-7>
export CXX=<path/of/g++7>
cd <path/to/ncnn/root/directory>
make build
cd build
cmake .. -DNCNN_PYTHON=ON
make -j8 && make install
cd ../python
python setup.py install

lvhan028 avatar Sep 26 '21 11:09 lvhan028

i follow lvhan028 commented on 26 Sep
and in the last step not cd ../python python setup.py install
but cd ../
pip3 install .
then is ok and you can read the readme.md in the folder named "python"

yangc1991 avatar Nov 11 '21 10:11 yangc1991

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic
  • First install pybind11
  • Second install ncnn
$ pip install pybind11 
$ pip install ncnn

Digital2Slave avatar Jul 28 '22 01:07 Digital2Slave

I meet the same error in MacOS. And i have tried all the methods upstairs。

dianxin556 avatar Dec 02 '22 03:12 dianxin556

I get this too. Python package is broken

redthing1 avatar Jul 30 '23 17:07 redthing1

I get the same error while running from terminal. However, importing into shell / notebook works.

After building from source,

cd python
ipython
> import ncnn

saikatkumardey avatar Aug 28 '23 06:08 saikatkumardey