Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't locate plots package
#1
I am trying to run some legacy code that was created last year by a teammate, and that includes the following initial line:

from plots import COLORS10, enlarge_tick_fontsize
However, when I run this line from my Spyder3 editor, the following error message results:

Error:
from plots import COLORS10, enlarge_tick_fontsize Traceback (most recent call last): File "<ipython-input-30-44011da13a42>", line 1, in <module> from plots import COLORS10, enlarge_tick_fontsize ModuleNotFoundError: No module named 'plots'
If I try to do

pip install plots

in the Anaconda console, the following error message results:

Error:
Could not find a version that satisfies the requirement plots (from versions: ) No matching distribution found for plots
Similarly, trying

conda install plots

Yields this error message:

Error:
Fetching package metadata ...... PackageNotFoundError: Packages missing in current channels: - plots
Googling "Python plots package", I am not seeing any likely candidates for packages available to install. I will appreciate any suggestions about whether there is still a "plots" package that exists, and how to access it. Thank you!!
Reply
#2
At first, I thought maybe it was a lib they wrote themselves, but then that line you shared...
from plots import COLORS10, enlarge_tick_fontsize
...is a line I found verbatim on an older website.  So it's definitely a distributed package of some sort, or at least it used to be.  And if it used to exist in pip, then it should still be cached somewhere... but I haven't had any luck finding anything.

matplotlib is (I think) the defacto best plotting lib in python, so it might just be a convenience wrapper around that.  Do you have access to the machine it used to run on?  You could peek at the site-packages to see if maybe it installs itself using a different name (like how the PIL package is listed in pypi as "pillow").

It's a little late for that now, but this sort of thing is exactly what pipenv, and it's predecessor virtualenv, aimed to fix.  By having all needed packages listed in a piplock file, it's easy to install them in new places (or in the future, if you don't know what packages are even needed).
Reply
#3
Thanks for your response, nilamo. Unfortunately, no, I don't have access to the machine the script used to run on.

So, it sounds like I might just need to rewrite parts the existing script using matplotlib instead of the plots package... Thanks for suggesting this strategy.
Reply
#4
If it was a package, it'd be listed on pypi (the python package index): https://pypi.python.org
If it isn't there, then it might just be some random code from a github or something, in which case it becomes incredibly difficult to find.
Reply
#5
It's in this repo.
There is no installation,so you just call plots.py.
Reply
#6
How in the world did you find that?
Reply
#7
Thanks for locating that, snippsat!

If I try to call

from plots.py import COLORS10, enlarge_tick_fontsize
I get the error:

Error:
File "plots.py", line 7 <!DOCTYPE html> ^ SyntaxError: invalid syntax
Am I doing something wrong with my call? Thanks for your input.
Reply
#8
(Oct-04-2017, 06:51 PM)nilamo Wrote: How in the world did you find that?
Just search for from plots import COLORS10
BobLoblaw Wrote:Am I doing something wrong with my call? Thanks for your input.
There is no .py when you import.
So you call it as in first post.
Reply
#9
Thanks for your clarification, snippsat; I should have mentioned that I already tried that:

from plots import COLORS10, enlarge_tick_fontsize
It results in this error message:

Error:
File "plots.py", line 7 <!DOCTYPE html> ^ SyntaxError: invalid syntax
I'm going to continue working to resolve this error...
Reply
#10
How are you downloading the file?  There shouldn't be any html anywhere in it, and line 7 should be from matplotlib import rcParams .
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple Plots in Spyder PythonAndMe2023 0 821 Feb-03-2023, 07:00 PM
Last Post: PythonAndMe2023
  Subplot - Plotting 4 plots on the same row Menthix 1 1,392 Nov-07-2021, 09:03 PM
Last Post: deanhystad
  How do I locate setup.py in my computer, or install the file? JaneTan 1 1,698 Aug-26-2021, 08:37 AM
Last Post: snippsat
Photo i want to locate an image according to the mouse position rachidel07 1 2,787 Feb-08-2021, 03:29 PM
Last Post: michael1789
  Locate QR code on a page Pedroski55 0 1,346 Jan-21-2021, 07:11 AM
Last Post: Pedroski55
Photo Locate Noise floor level for a spectral data in Python Ranjan_Pal 1 2,991 Dec-19-2020, 10:04 AM
Last Post: Larz60+
  How to Locate an Attribute's Parent Object? calvinsomething 5 2,932 Nov-13-2020, 01:52 AM
Last Post: calvinsomething
  Sharing X Axis in Sub plots JoeDainton123 1 2,142 Aug-22-2020, 04:11 AM
Last Post: deanhystad
  Help With Sub Plots JoeDainton123 0 1,676 Aug-20-2020, 10:48 PM
Last Post: JoeDainton123
  Group scatter plots Mekala 0 1,619 Jul-23-2020, 02:18 PM
Last Post: Mekala

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020