ModuleNotFoundError in Python: No module named story

problem

pip install flask throws a title error when ʻimport. If anything, pandas also throws an error when ʻimport.

Run away, gyro! !! This is a stand attack! !! !!

spoiler

It was Inkscape's fault. (For those who don't seem to be related to Inkscape here, go to [Bonus](#Bonus-For those who were not related to inkscape))

Cause investigation

First, check if you can install it properly without rushing. Click the code below at the terminal.

pip list

result 2020-09-16 (3).png

Hmmmm. The installation is done properly.

Then next. Find out what directory Python is looking for when importing modules. Open a Python console and run the following code.

import sys
import pprint
pprint.pprint(sys.path)

The result is 2020-09-16 (4).png

(゚ д ゚) ・ ・ ・   (Tsu д⊂) Gojigoshi   (; ゚ д ゚) ・ ・ ・   (Tsu д⊂) Goji Goji Goji

(;; ゜ Д ゜)…! ??

Inkscape!?

By the way, when I installed Inskcape during this time, it seems that I checked the environment variable PATH additionally ... ** Inkscape, you can't forgive me! !! !! **(passing the buck) (For those who were not related to Inkscape here, go to [Bonus](#Bonus-For those who were not related to inkscape))

Coping

Python refers to a strange place because the ** environment variable ** PATH is out of order. You can re-edit this to make it decent.

Environment variables can be set from Control PanelSystem and Security SystemSystem Advanced Settings Environment Variables (in the left column). This time, the problem is not the user environment variable, but the system environment variable PATH (may be lowercase depending on the environment) in the column below. Select this and edit. Erase the path that says Inkscape. 2020-09-16 (5).png

After erasing, save and restart. Check it out ... 2020-09-16 (6).png

ktkr~~~~~~!!!!! case being settled.

Summary

Don't add weird things to Hoi Hoi and the environment variable PATH!

Bonus (to those who were not related to Inkscape)

First of all, please check if the module in the [Cause investigation](#Cause investigation) section has been installed. If the installation is wrong, install it again, if it is done, use the following code.

pip show [Module name that is in trouble because it cannot be imported]

This code will tell you the location of the module. Then open the Python console to see where Python is looking to import. The procedure is in [Cause Investigation](# Cause Investigation) (what is sys on the console).

Do Python references and module locations match? Probably not in agreement. If so, add the folder where Python is installed to the environment variable PATH by referring to the method of setting the environment variable in the [Corrective action](# Action) section. The Python installation folder may vary from person to person, but in my environment it was in C: \ Users \ [my name] \ AppData \ Local \ Programs \ Python \ Python38.

If you can't find it, look for Python in the Start menu and right-click menu Other Open File Location, Open File Location from the right-click menu of the one selected in the opened folder (probably a Python shortcut). This will take you to the folder where python is installed.

If you don't have Python in the Start menu in the first place, give up and reinstall Python. At that time, take a closer look at the installation screen and check Add to environment variable PATH. That should solve it.

Have a good Python life!

Recommended Posts

ModuleNotFoundError in Python: No module named story
Today's python error: ModuleNotFoundError: No module named
[Python] ModuleNotFoundError: No module named'urlparse'
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'
ModuleNotFoundError in poetry: No module named'setuptools'
Suddenly with Python PyInstaller No module named pyinstaller
Today's python error: ModuleNotFoundError: No module named'requests'
Today's python error: ModuleNotFoundError: No module named'bs4'
Import Error in Python3: No module named'xxxxx'
How to resolve ModuleNotFoundError: No module named XXX in Jupyter Notebook
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
ModuleNotFoundError: No module named'py4j'
ModuleNotFoundError: No module named'flask_sqlalchemy'
python> import seiral> ImportError: No module named serial
Resolve No module named tkinter
A story about a python beginner stuck with No module named'http.server'
'lambda_function': No module named When'selenium' appears
There is no switch in python
Python unittest module execution in vs2017
[Question] No module named'Selenium' in PyCharm
Master the weakref module in Python
A story about a Python beginner who was about to be crushed by ModuleNotFoundError: No module named'tweepy'
What to do if you get Swagger-codegen in python and Import Error: No module named
Why ModuleNotFoundError: No module named'dataset.mnist' appears in "Deep Learning from scratch".
python / netCDF / CentOS 6.8> ImportError: No module named netCDF4> sudo yum install netcdf4-python.x86_64
When lambda-uploader says No module named xxxx.
Microsoft Cognitive Toolkit: ModuleNotFoundError: No module named'cntk._cntk_py'
Implementation module "deque" in queue and Python
In python + sqlite3 "OperationalError: no such column:"
Module import and exception handling in python
Install the Python module in any directory
Upgrading Python module in OSX El Capitan
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
Python module import
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
How to deal with "No module named'〇〇'" error in Jupyter Notebook | Install with! Pip!
nCr in python
Use cryptography module to handle OpenSSL in Python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
The story of reading HSPICE data in Python
Sqlite in python
StepAIC in Python
Wall to put OpenCV 3.1.0 in raspberry pi 3 and run sample on python3: ImportError: No module named cv2 solution
I tried adding a Python3 module in C