The first error is just that both libraries are really big and require too many C functions. You can look for the error message on google. That also happens quite often with matlab for example when you try and load big libraries.
The second one is a problem with caffe I guess, or pytorch loading some library that caffe does not expect and makes it crash.