Welcome, Guest
Username: Password: Remember me

TOPIC: A error “ModuleNotFoundError: No module named 'telapy'”

A error “ModuleNotFoundError: No module named 'telapy'” 2 years 10 months ago #39639

  • yixiang
  • yixiang's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
Dear all,
I got error “ModuleNotFoundError: No module named 'telapy'” at Line “from telapy.api.t2d import Telemac2d” while running file ‘telenkf_t2d_estination.py’.

I type “python -c ‘import sys; print(sys.path)’” at the terminal and return ["/home/sun/.local/lib/python3.8/site-packages","/home/sun/anaconda3/lib/python3.8/site-packages","/home/sun/anaconda3/lib/python38.zip","/home/sun/anaconda3/lib/python3.8","/home/sun/anaconda3/lib/python3.8/lib-dynload"].

I added these values to ‘python.analysis.extraPaths’ of VSCode’s Settings, but the error still exists.

What can I do to resolve this error? Thanks!

Sun
Attachments:
The administrator has disabled public write access.

A error “ModuleNotFoundError: No module named 'telapy'” 2 years 6 months ago #40441

  • hedmondjohn
  • hedmondjohn's Avatar
To make it short, it means that you lacked some "dependencies" for the libraries you wanted to use. This is a common problem when installing python packages, mainly in windows. Before trying to use any kind of library, first it is suggested to look up whether it needs another library in python "family".

The solution is to provide the python interpreter with the path-to-your-module/library. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys
sys.path.append('my/path/to/module/folder')

This isn't a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../

#each path must be separated by a colon
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.