Import Error in Python3: No module named'xxxxx'

Premise

--brew install python3. Installed under / usr / local / Celler with sudo --A state in which an arbitrary environment test is created and activated with pyvenv --pip3 install jinja2 (or mako) and the library is included. --Pip3 freeze also shows the above library

I can load standard modules, but I can't load modules installed with pip (3).

    Traceback (most recent call last):
    File "example.py", line 9, in <module>
    from jinja2 import Template
    ImportError: No module named 'jinja2'

Add to sys.path and load

    #!/usr/bin/env python
    # coding: utf-8
    
    import sys
    sys.path.append('/usr/local/lib/python3.3/site-packages')
    
    from jinja2 import Template
    
    assert Template

reference

http://stackoverflow.com/questions/20099481/python3-importerror-no-module-named-myfile

Recommended Posts

Import Error in Python3: No module named'xxxxx'
ModuleNotFoundError: No module named'_bz2' error in pyenv Python
Import cv2 ModuleNotFoundError: No module named'cv2' in python3
Python error: ModuleNotFoundError: No module named'flask'
Python module import
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named
ModuleNotFoundError in Python: No module named story
Module import and exception handling in python
Today's python error: ModuleNotFoundError: No module named'bs4'
python original module import
What to do if you get Swagger-codegen in python and Import Error: No module named
Solution for "Import Error: No module named requests"
python> import seiral> ImportError: No module named serial
How Python module import works
I get an Import Error in Python Beautiful Soup
Dynamically import scripts in Python
Slice error in python (´ ; ω ; `)
[Python] logging in your own module
Working with LibreOffice in Python: import
There is no switch in python
Python unittest module execution in vs2017
ModuleNotFoundError in poetry: No module named'setuptools'
Master the weakref module in Python
I get "sanity check" and "No module" errors in import numpy
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
Import error even though python is installed
Suddenly with Python PyInstaller No module named pyinstaller
Implementation module "deque" in queue and Python
Revived from "no internet access" in Python
Comparison of Japanese conversion module in Python3
[Illegal hardware instruction python] error in PyMC3
In python + sqlite3 "OperationalError: no such column:"
windows7 / python3.3 / virtualenv / cx_Freeze / Import Error / MAXREPEAT
Module to generate word N-gram in Python
Install the Python module in any directory
How to resolve "No kernel of grammar Python found" error in Atom
Dealing with Python error "Attribute Error: module'scipy.misc' has no attribute'imresize'" in deep learning
I get a Python No module named'encodings' error with the aws command
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Summary of how to import files in Python 3
AttributeError: module'urllib' has no attribute'request' error in urllib.request
Resolve Japanese write error UnicodeEncodeError in Python files
Error in random.shuffle
Epoch in Python
Sudoku in Python
DCI in Python
Import python script
quicksort in python
How to deal with "No module named'〇〇'" error in Jupyter Notebook | Install with! Pip!
nCr in python
scikit-learn import error
Python Error Handling