One: Compiler FE: nncc build failure: cannot resolve pip

Created on 1 Jul 2020  路  8Comments  路  Source: Samsung/ONE

I get the following error when trying to build nncc (without docker, on a Ubuntu 18.04 installation):

[ 24%] Built target circle-verify
[ 24%] Built target circle-inspect
[ 24%] Generating requirements.txt
/home/$ONE_FOLDER/ONE/build/compiler/tf2tfliteV2-conversion-test/venv/bin/python: No module named pip
compiler/tf2tfliteV2-conversion-test/CMakeFiles/tf2tfliteV2_conversion_test_python_deps.dir/build.make:66: recipe for target 'compiler/tf2tfliteV2-conversion-test/requirements.txt' failed
make[2]: *** [compiler/tf2tfliteV2-conversion-test/requirements.txt] Error 1
make[2]: *** Deleting file 'compiler/tf2tfliteV2-conversion-test/requirements.txt'
CMakeFiles/Makefile2:8757: recipe for target 'compiler/tf2tfliteV2-conversion-test/CMakeFiles/tf2tfliteV2_conversion_test_python_deps.dir/all' failed
make[1]: *** [compiler/tf2tfliteV2-conversion-test/CMakeFiles/tf2tfliteV2_conversion_test_python_deps.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

To my knowledge, I have both python2.7 and python3.6 installed on my system. Moreover, I have installed pip (version 9.0.1-2.3~ubuntu1.18.04.1) for both the python versions. Could anyone kindly let me know what is the cause for the error above? Thanks in advance.

help wanted

All 8 comments

No module named pip

Maybe https://stackoverflow.com/questions/18363022/importerror-no-module-named-pip ?

sudo apt-get install python3-pip

or

sudo apt-get install python-pip

I tried them both and got a message saying that they are already installed at the newest version (9.0.1-2.3~ubuntu1.18.04.1).

May I know which python version does nncc build use? Accordingly, I can try ensurepip to see if that works.

May I know which python version does nncc build use?

Mine is 3.5.2 as I use old Ubuntu 16.04. I think any 3.x version will work.

have you installed

sudo apt-get install python3-venv

?

I have installed python3-env as described above. I tried running python3 -m ensurepip, but got the following error:

ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules for the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

I then tried disabling pip for the virtual enviroment using the following command python3 -m venv myvenv --without-pip --system-site-packages. This too, failed to work for me, as the build error continues to appear.

@seanshpark ,it seems the problem is resolved.

Thank you for mentioning python3-venv. I did install it, but I did so after an initial build failure. Following the error described above, I upgraded pip (using the instructions described here to function inside the venv. The errors continued as before. Finally, I got over it by cleaning the build and starting again.

I am not sure which of the steps above solved the issue, but I am inclined to suggest the following steps in order:

  1. sudo apt-get install python3-venv (or python2, whichever is appropriate)

  2. rm -rf build

  3. ./nncc configure -DENABLE_TEST=1

  4. ./nncc build

Please let me know if I miss anything. Thanks a lot for your inputs.

DISABLE_TEST=1

Was there any problems without this? We usually build and run tests while development.

DISABLE_TEST=1

Was there any problems without this? We usually build and run tests while development.

I am sorry, the option was -DENABLE_TEST=1. The above line is a typo.

ENABLE_TEST always ON by default.

FYI,
AFAIK, above error happens when we upgrade pip and it somehow fails.

So you can try one of three as of now.

  1. Remove build directory and then rebuild
  2. Create virtual environment by hand and then copy or move it to the module that error occurred.
$ python3 -m venv venv
$ mv venv ${YOUR_ONE_REPO}/build/${ERROR_MODULE}/
$ ./nncc build
  1. Activate the virtual environment in that module and then install pip by hand.
$ source ${YOUR_ONE_REPO}/build/${ERROR_MODULE}/venv/bin/activate
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py
$ ./nncc build
Was this page helpful?
0 / 5 - 0 ratings

Related issues

underflow101 picture underflow101  路  4Comments

seanshpark picture seanshpark  路  3Comments

KimDongEon picture KimDongEon  路  4Comments

mhs4670go picture mhs4670go  路  4Comments

ragmani picture ragmani  路  4Comments