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! !! !!
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))
First, check if you can install it properly without rushing. Click the code below at the terminal.
pip list
result
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
(゚ д ゚) ・ ・ ・ (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))
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 Panel
→ System and Security
→ System
→ System 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.
After erasing, save and restart. Check it out ...
ktkr~~~~~~!!!!! case being settled.
Don't add weird things to Hoi Hoi and the environment variable PATH
!
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