Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Model training walkthrough produces: Fatal error: 'try!' expression unexpectedly raised an error: Python exception: No module named 'matplotlib' #566

@arielelkin

Description

@arielelkin

I'm following the Tensorflow Model training walkthrough, but I'm getting a runtime error very early on, at this line:

import TensorFlow
import PythonKit

let plt = Python.import("matplotlib.pyplot")

the error is:

Fatal error: 'try!' expression unexpectedly raised an error: Python exception: No module named 'matplotlib': file PythonKit/Python.swift, line 673
2020-11-17 17:58:46.218246+0100 TensorMac[44863:607287] Fatal error: 'try!' expression unexpectedly raised an error: Python exception: No module named 'matplotlib': file PythonKit/Python.swift, line 673

I'm running Xcode 12.1, have followed all the steps in Installation.md and installed the Swift for TensorFlow 0.11 Release Xcode toolchain.

I'm able to import those libraries from the Pyton REPL:

$ python
Python 2.7.16 (default, Jun  5 2020, 22:59:21) 
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib
>>> 

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions