0

I am getting the error ImportError: cannot import name 'plot' from 'plot', and I don't know how to fix it. I believe it's tied to the import that I'm using; chart. Full traceback (if that helps):

  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 606, in _load_from_module_spec
    spec.loader.exec_module(lib)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "c:\Users\User\Downloads\Stock Bot\Different Bot Code\Stock\stock-master-master\cogs\charts.py", line 13, in <module>
    import charts as c
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\charts\__init__.py", line 5, in <module>
    from plot import plot, plotasync, line, area, spline, pie
ImportError: cannot import name 'plot' from 'plot' (C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\plot\__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\Users\User\Downloads\Stock Bot\Different Bot Code\Stock\stock-master-master\bot.py", line 32, in <module>
    bot.load_extension(f"cogs.{filename[:-3]}")
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.charts' raised an error: ImportError: cannot import name 'plot' from 'plot' (C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\plot\__init__.py)

I've seen a couple of threads discussing this issue, but none of them (from what I've seen) provide a sustainable fix. Anyone know a fix?

Nexus
  • 23
  • 4
  • Does this answer your question? [How to debug charts package 'No module named 'plot' ' Error](https://stackoverflow.com/questions/31559475/how-to-debug-charts-package-no-module-named-plot-error) – Feras Alfrih Jan 02 '22 at 14:17
  • This is one of the posts I looked at. It helped to some degree, but I didn't understand how I would "Write the directory you mentioned containing the plot etc. into pythonpath". The link they referenced didn't exactly help to clarify either. – Nexus Jan 02 '22 at 14:44
  • The module itself has a problem i guess... – Feras Alfrih Jan 02 '22 at 14:47
  • No fixes then ? – Nexus Jan 02 '22 at 14:51
  • maybe others have, but for me it didn't work at all... i tried **venv** error raised `no module plot` even it's existed in **site-packages** – Feras Alfrih Jan 02 '22 at 14:53
  • 1
    I've migrated the code to matplotlib, but it's disappointing y'know – Nexus Jan 03 '22 at 15:49
  • Yes I do... today i figuered out that the problem I told you about is because of **conda env** I will retry after I solved it and get back to you with the results – Feras Alfrih Jan 03 '22 at 16:53
  • Alright, thank you – Nexus Jan 03 '22 at 17:18

0 Answers0