Question:
Pycharm shows those classes that cannot be referenced, even if they are in the project.
Analysis:
Pycharm defaults the project’s root directory to the source directory, so if the import USES an absolute path instead of a relative path, it will be looked up in the project’s root directory, not the project’s own root directory.
Methods:
Set the root directory of the item in Pycharm:
The file – & gt; Setting – & gt; Project: server – & gt; project structure
Set the path to Source in the root directory of the project.
Pycharm shows those classes that cannot be referenced, even if they are in the project.
Analysis:
Pycharm defaults the project’s root directory to the source directory, so if the import USES an absolute path instead of a relative path, it will be looked up in the project’s root directory, not the project’s own root directory.
Methods:
Set the root directory of the item in Pycharm:
The file – & gt; Setting – & gt; Project: server – & gt; project structure
Set the path to Source in the root directory of the project.
Read More:
- How to solve the import failure by prompting beautifulsoup under pychar
- Solve the problem of red wavy line in pychar when importing module written by oneself
- Pychar has a problem downloading module [install packages failed: installing packages: error occurred. Details…]
- Solve the problem of raspberry pie using GStreamer. Importerror: cannot import name XXX introspection typelib not found
- Python_ Part 2 programming problems (3)_ solve numpy.core.multiarray Failed to import problem
- The fastest way to solve the problem of error reporting from crypto.cipher import AES
- Solve the problem of import Cafe: runtimewarning: numpy.dtype Size changed, may indicate binary instability
- numpy.core.umath How to solve the problem of failed to import
- Due to multi process — pychar debug breakpoint debugging encounter pychar dataloader will be stuck
- The problem of unable to install win32gui in building Anaconda environment in pychar
- On the problem of from PIL import image
- Solved! The new version of statsmodels has the problem of importerror: cannot import name ‘factorial’
- An error is reported about import Java. SQL. *; problem
- Pychar configures Anaconda environment
- Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘
- To solve the problem of failed to load: data in HTML5 game running rmmv locally/ actors.json problem
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- MacOS uninstall clean pychar
- Pychar runtime error r6034 solution
- Cannot call the same level library solution in pychar