In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
When using PyCharm, we often encounter py scripts written by import itself, which prompt that the module is not located, resulting in import failure.
Let's look at an example:
Directory structure:
-the code actually written
-Interface
-* * _ check.py
Test_***_all_copy.py
We need to import the sibling directory under the folder interface in the test_***_all_copy.py script.
* * _ check.py all the classes and functions contained in the py file.
The following words are incorrect:
If you directly import all the files under * * _ check, an error will be reported.
All the py files in this import folder, which is written incorrectly, will prompt that the relevant class or function cannot be found under * _ check.
This kind of writing directly to the top-level directory of project is sometimes successful. But I failed this time, so you can use it according to the situation.
The following import method is correct, which is directly followed by the py file * check from the interface of the same level directory.
Import all under Interface.***_check.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.