Keras and scipy throwing weird errors....while installing on jetson nano.. no links could help me.

ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-tsizghqc/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i Simple index – wheel setuptools ‘Cython>=0.29.13’ ‘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.17.3; python_version>=’“'”‘3.8’“'”’ 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’”‘"’’ ‘numpy==1.17.3; python_version>=’“'”‘3.8’“'”’ and platform_system==‘"’“‘AIX’”‘"’’ Check the logs for full command output.
Exception information:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py”, line 153, in _main
status = self.run(options, args)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/install.py”, line 382, in run
resolver.resolve(requirement_set)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py”, line 201, in resolve
self._resolve_one(requirement_set, req)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py”, line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/legacy_resolve.py”, line 313, in _get_abstract_dist_for
req, self.session, self.finder, self.require_hashes
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py”, line 224, in prepare_linked_requirement
req, self.req_tracker, finder, self.build_isolation,
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/operations/prepare.py”, line 49, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/distributions/source/legacy.py”, line 37, in prepare_distribution_metadata
self._setup_isolation(finder)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/distributions/source/legacy.py”, line 63, in _setup_isolation
“Installing build dependencies”
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/build_env.py”, line 201, in install_requirements
call_subprocess(args, spinner=spinner)
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/utils/subprocess.py”, line 242, in call_subprocess
raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-tsizghqc/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i Simple index – wheel setuptools ‘Cython>=0.29.13’ ‘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.17.3; python_version>=’“'”‘3.8’“'”’ 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’”‘"’’ ‘numpy==1.17.3; python_version>=’“'”‘3.8’“'”’ and platform_system==‘"’“‘AIX’”‘"’’ Check the logs for full command output

Im really having a very bad time with jetson nano, please do help me ASAP
The error posted is only of keras, the scipy also throwing the same error.

Hi,

We’re very sorry to hear that you had a bad experience at Jetson Nano.

May I know how do you install keras and scipy library?
We have verified that keras and scipy can be installed with the following command:

$ sudo apt-get install gfortran
$ sudo apt-get install -y build-essential libatlas-base-dev
$ sudo pip3 install keras

Could you give it a try?

Thanks.

Thank you

Hi,I had the same problem. I have tried these commands. Howerver,it doesn’t work
I’m using XAvier
nvidia@nvidia-desktop:~$ sudo apt-get install gfortran
Reading package lists… Done
Building dependency tree
Reading state information… Done
gfortran is already the newest version (4:7.4.0-1ubuntu2.3).
0 upgraded, 0 newly installed, 0 to remove and 285 not upgraded.
nvidia@nvidia-desktop:~$ sudo apt-get install -y build-essential libatlas-base-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version (12.4ubuntu1).
libatlas-base-dev is already the newest version (3.10.3-5).
0 upgraded, 0 newly installed, 0 to remove and 285 not upgraded.
nvidia@nvidia-desktop:~$ sudo pip3 install keras
Collecting keras
Using cached https://files.pythonhosted.org/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/dist-packages (from keras) (1.13.0)
Requirement already satisfied: numpy>=1.9.1 in /usr/local/lib/python3.6/dist-packages (from keras) (1.17.4)
Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras) (2.10.0)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from keras) (3.12)
Collecting scipy>=0.14
Using cached https://files.pythonhosted.org/packages/a7/5c/495190b8c7cc71977c3d3fafe788d99d43eeb4740ac56856095df6a23fbd/scipy-1.3.3.tar.gz
Installing build dependencies … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-86xiwy8_/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index – wheel setuptools ‘Cython>=0.29.13’ ‘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.17.3; python_version>=’“'”‘3.8’“'”’ 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’”‘"’’ ‘numpy==1.17.3; python_version>=’“'”‘3.8’“'”’ and platform_system==‘"’“‘AIX’”‘"’’
cwd: None
Complete output (39 lines):
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.6/dist-packages/pip/main.py”, line 16, in
from pip._internal.main import main as _main # isort:skip # noqa
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/main.py”, line 8, in
import locale
File “/usr/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 53, in apport_excepthook
if not enabled():
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 24, in enabled
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

Original exception was:
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.6/dist-packages/pip/main.py”, line 16, in
from pip._internal.main import main as _main # isort:skip # noqa
File “/usr/local/lib/python3.6/dist-packages/pip/_internal/main.py”, line 8, in
import locale
File “/usr/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-86xiwy8_/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index – wheel setuptools ‘Cython>=0.29.13’ ‘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.17.3; python_version>=’“'”‘3.8’“'”’ 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’”‘"’’ ‘numpy==1.17.3; python_version>=’“'”‘3.8’“'”’ and platform_system==‘"’“‘AIX’”‘"’’ Check the logs for full command output.
Please help me,Thanks!

Hi,

It looks like the error is caused by scipy.

It’s recommended to install scipy with the following steps and try it again:

1. Install prerequisite

sudo apt-get update
sudo apt-get install -y build-essential libatlas-base-dev gfortran libfreetype6-dev python3-setuptools
sudo apt-get install -y protobuf-compiler libprotobuf-dev openssl libssl-dev libcurl4-openssl-dev

2. Upgrade cmake

wget http://www.cmake.org/files/v3.13/cmake-3.13.0.tar.gz
tar xpvf cmake-3.13.0.tar.gz cmake-3.13.0/
cd cmake-3.13.0/
./bootstrap --system-curl 
make -j8
echo 'export PATH=/home/nvidia/cmake-3.13.0/bin/:$PATH' >> ~/.bashrc
source ~/.bashrc

3. Install scipy

wget https://github.com/scipy/scipy/releases/download/v1.3.3/scipy-1.3.3.tar.gz
tar -xzvf scipy-1.3.3.tar.gz scipy-1.3.3
cd scipy-1.3.3/
python3 setup.py install --user

Thanks.

2 Likes

I am trying to build scipy-1.4.1 on nano following the above directions but am running into this compilation failure; I was able to build scipy-1.3.3 successfully following the above directions, however I need v1.4.1 for my work:

$ python3 setup.py install --user
...
creating build/temp.linux-aarch64-3.6/scipy/fft
creating build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft
compile options: '-DPOCKETFFT_PTHREADS -I/home/mike/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
extra options: '-std=c++14 -fvisibility=hidden'
aarch64-linux-gnu-g++: scipy/fft/_pocketfft/pypocketfft.cxx
scipy/fft/_pocketfft/pypocketfft.cxx:15:10: fatal error: pybind11/pybind11.h: No such file or directory
 #include <pybind11/pybind11.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scipy/fft/_pocketfft/pypocketfft.cxx:15:10: fatal error: pybind11/pybind11.h: No such file or directory
 #include <pybind11/pybind11.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: Command "aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPOCKETFFT_PTHREADS -I/home/mike/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1

I was able to get it to build by doing “pip3 install pybind11” before “python3 setup.py install --user”

Can you try that?

1 Like

@aastalll - the command to set the path:

echo 'export PATH=/home/nvidia/cmake-3.13.0/bin/:$PATH' >> ~/.bashrc

refers to /home.nvidia which does not exist on the nano standard image.
I have been running the script commands you suggest on ~/.
If I mod the above export command to that where everything else was just installed, will it work?

I will try.

Why didn’t Nvidia just install all the data science stuff on the standard distribution image?
This would have saved all of us a lot of time.

I have spent the last several days just trying to ge scikit-learn installed which requires scipy which requires fortran. Ugh!

If you want to help developers get going with machine learning on your device, give us a tried and true install of Anaconda with all the data science stuff working and tested.

You will find a lot of happy campers after that.

After installing Anaconda on my Mac, I have never had to go through any kind of weird, ugly installs like this ever again.
I can just run data science projects at ease with Jupyter Notebooks and it works every time.

That is what 99% of your potential customers want to use the Nano for so get to it please.

4 Likes

Yes. I think the issue happens if you have an older system level pybind11. I uninstalled that and installed a version via pip install and it seemed to work.

Yes! If people didn’t want certain packages, just tell them to uninstall them. I think that would be a lot easier. Even better would be if they just gave us checklists for these packages to be installed on the SDK.

This worked for me! Thank you

I totally agree, after the advertising “AI for everybody”.
I think most Jetson customers comes with the idea of
installing their Jupyter Notebooks with data and try them on the Jetson Nano.

I am very frustrated. Why do I have to compile this stuff from source, when it could have been delivered ready to run in the JetPack.
(But hey, libre-office was installed ;-)