0

I have installed the library using command pip install --upgrade tableau-api-lib

It is also installed on my system

Package            Version
------------------ ---------
tableau-api-lib    0.1.45

python --version Python 3.10.6

But when I am running in on Jupyter, I am getting error that

ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_5860/1301965758.py in <module>
      1 import io
----> 2 from tableau_api_lib import TableauServerConnection 
      3 from tableau_api_lib.utils.querying import get_views_dataframe, get_view_data_dataframe

ModuleNotFoundError: No module named 'tableau_api_lib'

I have tried restarting the system and kernel.

  • Try `python3 -m pip install `, this will ensure you use the right `pip`. Use the `python` command you are using to run your program, if you have multiple pythons. – blackbrandt Aug 25 '22 at 13:33
  • Have you restarted notebook? Sometimes a restart is all you need – Oskar Aug 25 '22 at 13:33
  • here are some [solutions](https://stackoverflow.com/questions/43728431/relative-imports-modulenotfounderror-no-module-named-x) that might be helpful – Shad0w Aug 25 '22 at 13:35
  • first check if `pip --version` gives the same version as `python --version`. This `pip` can be configured to install modules for different version of Python. And Pythons don't share modules. – furas Aug 25 '22 at 16:30
  • inside Juputer you can run `print( sys.executable )` to get `/full/path/to/python` and you can use it to install module `/full/path/to/python -m pip install ...` – furas Aug 25 '22 at 16:32
  • Inside Jupyter, you can run the modern `%pip install` magic command to insure the installation is done where the environment is that is backing your notebook. (There's a conda magic equivalent, too.) See [here](https://discourse.jupyter.org/t/why-users-can-install-modules-from-pip-but-not-from-conda/10722/4?u=fomightez) for more information on the modern magics added for aid in installing packages for use with Jupyter. – Wayne Aug 25 '22 at 18:38

1 Answers1

0

I used the virtual environment to run the script. Installed the library in virtual environment and it worked like a charm.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 30 '22 at 23:16