error installing pytorch-pretrained-bert

Trying to install this python library but it keeps failing. I have installed the latest: torch-1.2.0a0+8554416-cp36-cp36m-linux_aarch64.whl from here:

pip3 install pytorch-pretrained-bert
Collecting pytorch-pretrained-bert
Using cached
Collecting regex (from pytorch-pretrained-bert)
Downloading (654kB)
100% |████████████████████████████████| 655kB 535kB/s
Collecting torch>=0.4.1 (from pytorch-pretrained-bert)
Could not find a version that satisfies the requirement torch>=0.4.1 (from pytorch-pretrained-bert) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
No matching distribution found for torch>=0.4.1 (from pytorch-pretrained-bert)


That is because torch version is 1.2.0a0+8554416 and it may not be recognized by the pip3.
You can try the installation with –ignore-installed config to see if helps.

But actually, I can install the pytorch-pretrained-bert package without issues:

nvidia@nvidia-desktop:~$ sudo pip3 install pytorch-pretrained-bert
WARNING: The directory '/home/nvidia/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/nvidia/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pytorch-pretrained-bert
  Downloading (123kB)
     |████████████████████████████████| 133kB 1.1MB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (1.16.4)
Collecting regex (from pytorch-pretrained-bert)
  Downloading (654kB)
     |████████████████████████████████| 655kB 14.7MB/s 
Collecting tqdm (from pytorch-pretrained-bert)
  Downloading (52kB)
     |████████████████████████████████| 61kB 10.0MB/s 
Requirement already satisfied: torch>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (1.2.0a0+8554416)
Collecting boto3 (from pytorch-pretrained-bert)
  Downloading (128kB)
     |████████████████████████████████| 133kB 14.7MB/s 
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (2.22.0)
Collecting botocore<1.13.0,>=1.12.235 (from boto3->pytorch-pretrained-bert)
  Downloading (5.7MB)
     |████████████████████████████████| 5.7MB 15.1MB/s 
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3->pytorch-pretrained-bert)
  Downloading (70kB)
     |████████████████████████████████| 71kB 10.5MB/s 
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->pytorch-pretrained-bert)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (2.6)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (1.22)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (2018.1.18)
Collecting docutils<0.16,>=0.10 (from botocore<1.13.0,>=1.12.235->boto3->pytorch-pretrained-bert)
  Downloading (547kB)
     |████████████████████████████████| 552kB 16.9MB/s 
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /usr/lib/python3/dist-packages (from botocore<1.13.0,>=1.12.235->boto3->pytorch-pretrained-bert) (2.6.1)
Building wheels for collected packages: regex
  Building wheel for regex ( ... done
  Created wheel for regex: filename=regex-2019.8.19-cp36-cp36m-linux_aarch64.whl size=615232 sha256=bbf8801e14f40159f051e150d43683a0a6ad9ca0b25746733698b55c54582638
  Stored in directory: /home/nvidia/.cache/pip/wheels/90/04/07/b5010fb816721eb3d6dd64ed5cc8111ca23f97fdab8619b5be
Successfully built regex
Installing collected packages: regex, tqdm, jmespath, docutils, botocore, s3transfer, boto3, pytorch-pretrained-bert
Successfully installed boto3-1.9.235 botocore-1.12.235 docutils-0.15.2 jmespath-0.9.4 pytorch-pretrained-bert-0.6.2 regex-2019.8.19 s3transfer-0.2.1 tqdm-4.36.1


glad it worked for you and the good news is that I tried it again and it installed just like for you.
don’t know if someone fixed something or just had a typo. only difference since last night is I shutdown the jetson and turned it back on this morning.

thank you for your help.


One possibility is that we execute the command with ‘root’.
Please let us know the result.


Thanks for your help. Yea it is working now and I did have to use sudo with the command for it to install.
Also for others using pytorch as you use more intense processing the unit will require the higher 5v - 4amp power adapter.
My unit kept shutting down after a certain amount of processing. I guess the OS/HW doesn’t catch this situation and it just shuts down.
Once I had the bigger power supply, it ran fine.